[SciPy-user] interpolation questions

josef.pktd at gmail.com josef.pktd at gmail.com
Thu Jun 25 04:54:01 EDT 2009


On Thu, Jun 25, 2009 at 1:07 AM, David J Strozzi<strozzi2 at llnl.gov> wrote:
> I have a few questions about interpolation in scipy.  First, it would
> be nice if the documentation included a concrete example, for
> instance:
>
> http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PiecewisePolynomial.html#scipy.interpolate.PiecewisePolynomial
>
> Now for my actual problem: I am specifying some profiles for a
> physics simulation, and would like to give a few (x,y) pairs and have
> a nice, smooth interpolation.  Actually, it is common for me to want
> to give extreme points, and get an interpolant that is monotonic and
> without overshoot on each interval.  Splines (for order above linear)
> are well-known to be very 'smooth' (lots of continuous derivs) but
> suffer from overshoot and non-monotonicity.
>
> Perhaps there's a good solution to this in piecewise polynomials?
> But there's no sample usage and I got confused about what 'list of
> lists' for y to use.
>
> I know of an interpolant, made by some other Livermorons (Frisch?
> SIAM JNA ~1980), which maybe is called pchip in matlab (piecewise
> cubic hermite interpolating polynomial).  It's supposed to be
> monotone and better than linear.
>
>
> Thanks for your help,
> David
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>

Just to get you started (I don't know anything about this)

help(interpolate.PiecewisePolynomial) is more informative than the online help

There are some examples in the tests in  scipy\interpolate\tests\test_polyint.py

There have been questions about monotonic interpolation before on the
mailing list, but I've never seen a positive answer.

Josef



More information about the SciPy-User mailing list