H
H
HappyLynx2017-11-25 12:55:50
Mathematics
HappyLynx, 2017-11-25 12:55:50

Is there a generalized algorithm for finding a monotonic function with respect to three points?

The DIY project needed a specific interpolation, ran into a lack of knowledge regarding the following.
Question 1.
Initial data: 3 points (x1,y1),(x2,y2),(x3,y3), and it is known that x1<x2<x3 and y1<y2<y3
Is there an algorithm for constructing a function that is monotonic on the interval (x1;x3) passing through these three points.
Polynomial quadratic interpolation is obviously not suitable due to the fact that the minimum or maximum of the function (the top of the parabola) can lie in the interval (x1;x3).
If someone knows the answer to this question, then the next two will be resolved automatically.
Question 2.
Is there an interpolation algorithm such that for each sequence of points x(n-1),x(n),x(n+1),x(n+2),...,x(k) satisfying the condition y( n-1)>=y(n)<y(n+1)<y(n+2)<...<y(k-1)>=y(k) (that is, points to the left and right of n above it, to the left and to the right of k below it, and the intermediate points increase) , the resulting function f(x) on the segment [x(n);x(k)] satisfies the conditions:
f(x(i)) = y(i ) for all i = n..k
f'(x) != 0 (that is, there are no local minima and maxima)
Question 3.
Similar to question 2, but additionally it is necessary that the number of points on the segment [x(n);x( k)], where f''(x)=0, is minimal. That is, the minimum number of function inflections.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andy_U, 2017-11-25
@Andy_U

Well, the first question is easy to answer. Piecewise linear interpolation satisfies all your requirements stated in the question :). And if we still take into account "additions and applications", then it is necessary to interpolate with the function
y = a + b * x + c * x ** 2
such that:
1) The value of the parabola at x1 is y1
2) The value of the function at x2 is y2
3) The derivative of the function at x2 is equal to the slope of the line in the right subinterval.
I'm too lazy to prove it, but it seems obvious that such a parabola will be monotonic on a subinterval.
PS If the straight line on the right subinterval does not suit you, it can also be slightly bent.
PPS However, this (and any similar) algorithm will not give a solution for a larger number of points, since the first derivative will have discontinuities, which, as I understand it, do not suit you. And under this condition, even for four points, it’s easy to come up with an example so that there is monotony, but always with an inflection - take 4 points on the S-shaped curve (two closer to the edges) ... And no matter how you turn, you can’t do without an inflection in the central region .

H
HappyLynx, 2017-11-25
@HappyLynx

I found a + b / (cx + d) to be the best answer to the first question. Those. a variation on the theme of the inverse function 1/x.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question