How to find location of Minimum in Interpolation function?

What you’re asking is basically an optimization question.

So when we have a discrete set or collection of numbers, ie: [1,2,3,4], we can instruct our computer to find the minimum value or index quite easily(min or argmin).

But when we have a “function”. We need to use numerical optimization methods more often then not. So there’s an awesome Julia package called Optim.jl(Optim.jl). Highly reccommend it!

Here’s an example…

using Interpolations, Optim
t= 1:0.1:2pi
y = sin.(t)
interp_cubic = CubicSplineInterpolation(t, y)
bounds = [1.0, (2pi) - 0.1]
t_interp = first(bounds):0.01:last(bounds) 
scatter([t], [y], label = "raw")
plot!([t_interp], [interp_cubic(t_interp)], label = "Spline")

opt = optimize(x -> interp_cubic(x), first(bounds), last(bounds))
t_min = Optim.minimizer(opt)
scatter!( [t_min], [interp_cubic(t_min)], color = :red,label = "estimated min")

minexample

Hope this helps.