How do I "stabilize" the interpolator that uses the roots?

60 Views Asked by At

In a previous question, I have been instructed that, in order to pass through all and only the distinct points $(x_{1}, 0) ... (x_{k}, 0)$ with a non-constant continuous function, I can simply use the product of the $(x -x_{n})$.

Now, I have actually tried that, but it seems that the interpolator starts oscillating like crazy with just 4-5 terms, after which it becomes pretty "inusable" in practice.

How can I modify this interpolator to have very "regular" and "stable" behavior? More similar to a $sin(x)$ wave, for instance.

Added: The ideal behavior for my applications would be a closed-form function that can be used with a large number of points, at each point changes sign, remains limited, but also does not vanish to zero.

enter image description here

Other related question.

In this case, the interpolator is zero when at least one of $k$ conditions of the type $(x = x_{n})$ is satisfied.

Given arbitrary $(x_{1}, 0) ... (x_{k}, 0)$, how can I find a similar interpolator that is zero at when least one of $k$ conditions of the type $((x = x_{n}) ~ and ~(x$ is an even integer$))$ is satisfied.

1

There are 1 best solutions below

10
On BEST ANSWER

If you just want to force the interpolator to remain within certain bounds, you can just use $\prod_{i=1}^k \sin(x-x_i)$. In the following pictures you can see, using $x_1 = 1, 2, \cdots, 5$, the different behaviour of $\prod_{i=1}^{5} (x - x_i)$ and $\prod_{i=1}^{5} \sin(x-x_i)$.

Another possibility could be using cubic splines. The last picture is obtained for the same set of points adding the extra constraint that it passes in $(0.5,1)$ (otherwise the result would be the zero function).

enter image description here enter image description here enter image description here