2

I only have a basic knowledge of calculus but I would like to know if it's possible to, given a set of points each with their own slopes, construct the simplest (or any) polynomial function that perfectly fits the given information.

In other words, a polynomial $P(x)$ would need to take on the value of each given ordinate at each given abscissa, and it's derivative, $P'(x)$ would need to take on the value of each given slope and each given abscissa.

I'm thinking that it might not be possible because if there's a series of points that lie on a straight line among many other, randomly distributed ones, the derivative $P'(x)$ would have a segment of constant value in the middle of the chaotic curvature surrounding it. I don't think that polynomial functions can have this kind of behavior, can they?

If it's indeed impossible to do this, is there any other way to construct a curve that fits the given data?

Meshal
  • 779
JaiPEG
  • 23
  • Please clarify " given a set of points each with their own slopes". A point does not have a slope. A numerical example would help. – NoChance Jun 30 '15 at 04:13
  • Oh, my bad. For example: a point {1, 2} with slope 5, a point {4, -1} with slope 1/2, and a point {5, 5} with slope 1. – JaiPEG Jun 30 '15 at 04:18
  • @EmmadKareem: I think s/he means the derivative at those points. – Gary. Jun 30 '15 at 04:18
  • @JaiPEG: Maybe you can use a Lagrange polynomial https://en.wikipedia.org/wiki/Lagrange_polynomial and use bump functions or mollifiers to change the value of $f'(x_i)$. – Gary. Jun 30 '15 at 04:20
  • That might be just what I'm looking for. The original problem I was working on didn't have any slope information. I'll see if can extend it to this case as well. Thanks! – JaiPEG Jun 30 '15 at 04:30
  • Also, consider this: https://en.wikipedia.org/wiki/Hermite_interpolation – NoChance Jun 30 '15 at 04:34
  • related: http://math.stackexchange.com/questions/837902/prove-there-exists-a-unique-n-th-degree-polynomial-that-passes-through-n1-p – chharvey Jun 30 '15 at 04:38

3 Answers3

3

I think what you want is Hermite interpolation.

Look here:

https://en.wikipedia.org/wiki/Hermite_interpolation

marty cohen
  • 107,799
1

Try this. Given points $x_1,...,x_n$, positions $y_1,...,y_n$, and slopes $y'_1,...,y'_n$, you will need a polynomial of degree $2n-1$ with coefficients $a_0,...,a_{2n-1}.$ Then the matrix equation

$$ \left(\begin{array}{cccccc} 1 & x_1 & x_1^2 & ... & ... & x_1^{2n-1}\\ \vdots & \vdots & \vdots & \ddots & & \vdots\\ 1 & x_n & x_n^2& ... & ... & x_n^{2n-1}\\ 0 & 1 & 2x_1 & 3x_1^2 & ... & (2n-1)x_1^{2n-2}\\ \vdots & \vdots & \vdots & \ddots & & \vdots\\ 0 & 1 & 2x_n & 3x_n^2 & ... & (2n-1)x_n^{2n-2}\\ \end{array}\right) \left(\begin{array}{c} a_0\\ a_1\\ \vdots\\ a_{2n-1} \end{array}\right) = \left(\begin{array}{c} y_1\\ \vdots\\ y_n\\ y'_1\\ \vdots\\ y'_n \end{array}\right) $$ is a mathematical way of representing what you want to do. If this system is consistent, your polynomial exists. As for your proposed counterexample, it seems that for the behavior you want, you would need an infinite number of points. This method only works for a finite number of points.

Plutoro
  • 22,730
  • 3
  • 41
  • 71
  • That's great. I only know a little about matrix multiplication but I'll go and refresh my memory on the topic. Thanks for the insight about the counterexample. – JaiPEG Jun 30 '15 at 04:54
1

This is an interpolation problem. Particularly a polynomial interpolation.

I would suggest Spline interpolation. It takes care of the smoothing properties at the end points.

  • In general, the more constraints/conditions you pose at the end points, the higher the order of the interpolation polynomial.

Check: https://en.wikipedia.org/wiki/Spline_interpolation

Meshal
  • 779