How can I interpolate a curve with relative min/max or roots at discrete points?

  • Thread starter Thread starter Rafajafar
  • Start date Start date
Click For Summary
To interpolate a curve with specified relative minima and maxima at discrete points, a polynomial approach can be utilized, where the local extrema occur at the points defined in the set. The derivative of the function, f'(x), should equal zero at these extrema, leading to the formulation of f'(x) as a product of factors corresponding to each point. The integral of this derivative will yield the desired curve, f(x). A key consideration is whether the number of terms in the polynomial can be minimized while still achieving the required extrema. Exploring alternative methods such as splines may also be beneficial for achieving the desired interpolation.
Rafajafar
Messages
4
Reaction score
0
Hi... I'm a programmer, and I think I can solve a particular problem I'm having a lot easier if I only had a little more knowledge in math. Perhaps one of you can point me in the right direction so I can teach myself what I want to know.

The concept is this:

You have a set of discrete points such that the set x = (a, b, c, d, ...). All points a, b, c, d, etc. are not periodic in nature (normally). In other words, they could be regular such as x = (2, 4, 6, 8), or x = (2, 4, 8, 16) but more often than naught they will have no pattern such as with x = (all primes).

Each of these points are to represent a relative min, a relative max, OR a relative min/max of an equation. (all three will work for my purposes). I need to interpolate a curve that has a relative min/max for each of the points in set {x}. Preferably, I would like this to be the sum of wave functions so that the actual equation itself can be reduced into a much simpler function via trig identities (more simple meaning easier for a computer to store... reduced). If that is not possible, some sort of spline could work too... maybe.

It does not matter what happens between the points, so long as at the points themselves they are a relative min/max. This min/max value can be a set number such as 1 / -1 . It doesn't matter, I just need them to peak at those discrete points and only those discrete points.

The cardinality of x is variable.

To help you picture what I'm talking about, picture a wave function with the peaks of the function being one of those discrete points.

What method should I use to accomplish this?

EDIT: Another alternative to min/max peaks could be the roots of the function.
 
Last edited:
Physics news on Phys.org
Rafajafar said:
Each of these points are to represent a relative min, a relative max, OR a relative min/max of an equation. (all three will work for my purposes). I need to interpolate a curve that has a relative min/max for each of the points in set {x}. Preferably, I would like this to be the sum of wave functions so that the actual equation itself can be reduced into a much simpler function via trig identities (more simple meaning easier for a computer to store... reduced). If that is not possible, some sort of spline could work too... maybe.
If I interprete this correctly, then what you need is a polynomial. The local max/min of the function (or local extrema) is just where f'(x) = 0.
Say, the function has the following set of extremas: {a, b, c, d, e}
Then f'(a) = f'(b) = f'(c) = f'(d) = f'(e) = 0
So, the simplest curve you can find is the anti-derivative of:
f'(x) = (x - a)(x - b)(x - c)(x - d)(x - e)
So the curve is:
f(x) = \int f'(x) dx
 
Is there any way to do this such that the number of terms is less than the number of points in the set of extrema?
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
Replies
4
Views
3K
Replies
4
Views
12K
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
11
Views
3K
  • · Replies 46 ·
2
Replies
46
Views
7K
Replies
1
Views
2K
Replies
2
Views
3K