[SciPy-user] Finding min/max of a B-Spline

Dominique Orban dominique.orban@gmail....
Fri Aug 17 18:45:16 CDT 2007

On 8/17/07, Willi Richert <w.richert@gmx.net> wrote:

> I have a sequence of n-dim points for which I approximate a spline via
> splrep
> and splev. For splev I can specify der=1 to get the first derivative
> evaluated. And there is sproot, which finds the roots of the originially
> created spline. However, with these methods I cannot find the roots of the
> first derivative to get the minima and maxima of the spline. How can that
> be
> achieved?

I am not sure how the code you used works, but typically, the branches of
your spline are represented implicitly. Each branch being a polynomial of
degree 3, you are able to work out by hand their constrained extrema (they
must lie between your interpolation points). Because the polynomials are of
degree 3, they have inflexion points, so it is not sufficient to find zeros
of the first derivative. Moreover, since they are constrained, the extrema
may occur at a point where the derivative doesn't vanish. Since there is a
finite number of interpolation intervals, you can find your global extrema
by comparing the spline values across all the minima and maxima that you

There must already be existing routines for this. Any good numerical
analysis book explains how to do this.

Good luck,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070817/259b6059/attachment.html 

More information about the SciPy-user mailing list