Lagrange and cubic spline interpolate

  • Thread starter Thread starter BearY
  • Start date Start date
  • Tags Tags
    Cubic Lagrange
Click For Summary
The discussion revolves around the observation that Lagrange interpolation and cubic spline interpolation yield the same results for a set of four data points. Participants note that since both methods produce cubic functions, it raises questions about the underlying reasons for their agreement. It is suggested that demonstrating how the Lagrange polynomial satisfies the conditions of cubic splines could clarify this relationship. Additionally, the uniqueness of the cubic spline solution implies that if the Lagrange polynomial meets all necessary conditions, it must also be the cubic spline solution. This connection highlights the mathematical consistency between the two interpolation methods.
BearY
Messages
53
Reaction score
8

Homework Statement


This is a bit unusual, I don't know whether I should post it here or math forum tbh.
When I was doing numerical method home work, I am required to do perform both of these interpolation on a set of 4 data points. It turns out that the result of these 2 methods always agrees with each other(not proven in any way, just by playing with data, that's why I am asking). We were asked to explain this. I have not a clue how this is happening.

Homework Equations

The Attempt at a Solution


Since there are 4 data points, the Lagrange polynomial is also a cubic function. I have that to start with.
I also have the formula of how the cubic splines are piece-wise calculated. But then I am stuck here.
Is it because of the formula or there is a deeper reason?
 
Last edited:
Physics news on Phys.org
BearY said:

Homework Statement


This is a bit unusual, I don't know whether I should post it here or math forum tbh.
When I was doing numerical method home work, I am required to do perform both of these interpolation on a set of 4 data points. It turns out that the result of these 2 methods always agrees with each other(not proven in any way, just by playing with data, that's why I am asking). We were asked to explain this. I have not a clue how this is happening.

Homework Equations

The Attempt at a Solution


Since there are 4 data points, the Lagrange polynomial is also a cubic function. I have that to start with.
I also have the formula of how the cubic splines are piece-wise calculated. But then I am stuck here.
Is it because of the formula or there is a deeper reason?
I think that is a good place to start. Show that both approaches produce the same equation for the dependent variable. You could do that by brute force, or you could show that the Lagrange polynomial solution satisfies all of the conditions of the cubic spline solution. (The second way is a lot easier.)
 
  • Like
Likes BearY
tnich said:
I think that is a good place to start. Show that both approaches produce the same equation for the dependent variable. You could do that by brute force, or you could show that the Lagrange polynomial solution satisfies all of the conditions of the cubic spline solution. (The second way is a lot easier.)
From what I know, the only (three if count separately) condition is neighbor splines have same value of ##f, f', f''## at the joint. The deriving of spline formula is also solely based on these conditions if I am not mistaken. Since the Lagrange polynomial is a polynomial, it naturally fits these criteria. But does fitting these criteria plus having 4 intersections making the cubic function equivalent?
edit: Since we are starting from those conditions, plus MATLAB uses not a knot method, and reached a unique solution to the 2nd derivatives of the four data points, does that mean any cubic function that fits these condition will be equivalent?
 
Last edited:
BearY said:
From what I know, the only (three if count separately) condition is neighbor splines have same value of ##f, f', f''## at the joint. The deriving of spline formula is also solely based on these conditions if I am not mistaken. Since the Lagrange polynomial is a polynomial, it naturally fits these criteria. But does fitting these criteria plus having 4 intersections making the cubic function equivalent?
I think you will need to show that the Lagrange polynomial solution fits the end conditions of the cubic spline, too. If the cubic spline solution is unique, and the (unique) Lagrange polynomial solution satisfies all of its conditions, then it must also be the unique cubic spline solution.
 
  • Like
Likes BearY
tnich said:
I think that is a good place to start. Show that both approaches produce the same equation for the dependent variable. You could do that by brute force, or you could show that the Lagrange polynomial solution satisfies all of the conditions of the cubic spline solution. (The second way is a lot easier.)
tnich said:
I think you will need to show that the Lagrange polynomial solution fits the end conditions of the cubic spline, too. If the cubic spline solution is unique, and the (unique) Lagrange polynomial solution satisfies all of its conditions, then it must also be the unique cubic spline solution.
Yes I see now Thank you.
 
Last edited:
Question: A clock's minute hand has length 4 and its hour hand has length 3. What is the distance between the tips at the moment when it is increasing most rapidly?(Putnam Exam Question) Answer: Making assumption that both the hands moves at constant angular velocities, the answer is ## \sqrt{7} .## But don't you think this assumption is somewhat doubtful and wrong?

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
2K
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
1
Views
2K