0

一般来说:给定一组本身是单调的任意数据,我应该如何计算额外的 n 个点来强制非单调三次插值(我必须使用它,没有其他选择)是单调的?

特别是对我来说:我有一个项目需要计算两个伺服器之间的关系。由于机器设计,伺服系统永远不应该备份。我希望我可以发布一张图片,但我刚刚注册并且还没有声誉。一组有代表性的点如下:

0: [0, 0](直线到 1)

1:[37.5, 45](三次曲线为 2)

2:[?, ?](三次曲线为 3)

3:[180, 60](三次曲线为 4)

4:[?, ?](三次曲线到 5)

5:[322.5, 75](直线到 6)

6:[360, 120](不适用)

我想要的行为以点 0、1、3、5 和 6 为特征。点 0 是固定的;其余的在运行时计算,并保证单调增加。保证整个绘图围绕点 3 对称。需要添加点 2 和 4,以便我必须使用的第三方线性/三次插值器产生尽可能平滑的单调曲线。(最小二阶导数)

有谁知道该怎么做?

4

1 回答 1

0

In the interest of time, I derived a solution myself:

  1. Translate the plot to be symmetric about the origin. (point 3 becomes [0, 0])

  2. Find the parabolic segment (constant acceleration) that takes the slope at point 1 to flat at [x, 0].

  3. If x has the same sign as point 1, then point 2 = [x, 0], point 4 = [-x, 0], and the segment in between should be linear.

  4. If x has the opposite sign or is zero, then the default interpolation is already monotonic. No additional points required.

  5. Once the parabolic segments are determined, in either case, add one more point to each side to convert them to cubic segments. (constant accel to ramp accel)

于 2014-04-10T14:10:29.207 回答