Difference in cubic spline formula

Click For Summary
The discussion highlights the differences between two cubic spline formulations: one expressed as s(x) = a + bx + cx^2 + dx^3 and the other as s(x) = a + b(x - t) + c(x - t)^2 + d(x - t)^3, where t is a reference point. Both forms are valid and depend on how one chooses to parametrize the spline, with the first form being more suitable for proofs and the second offering better numerical stability. The latter avoids issues with round-off errors that can occur when evaluating large values of x. A normalized parameter approach is also suggested for simplifying derivations and ensuring consistent results across different formulations.
zzmanzz
Messages
47
Reaction score
0

Homework Statement



Hi, this is more of a review question and I'm just looking at solutions of natural cubic spline equations and some will give the cubic spline as:

1. s(x) = a + bx + cx^2 + dx^3

on Wolfram

while other pages will give:

2. s(x) = a + b(x - t) + c(x-t)^2 + d(x-t)^3

where t is the first coordinate in the each point given. I'm not sure which is the standard version and it can make a difference when I evaluate the derivatives so any clarification is appreciated.
 
Physics news on Phys.org
As I didn't know the term cubic spline, I looked it up on Wikipedia and found
$$
c(t)=(2p_0-2p_1+m_0+m_1)t^3 + (-3p_0+3p_1-2m_0-m_1)t^2+m_0t+p_0=(2t^3-3t^2+1)p_0+(-2t^3+3t^2)p_1+(t^3-2t^2+t)m_0+(t^3-t^2)m_1
$$
so the answer seems to be: both, depending on how you would like to interpret and group the coefficients.
 
It's all how you want to parametrize the spline. The first form may be more convenient for proofs, defining each in terms of the same ##x##. But when you evaluate that, as ##x## gets larger and larger, so do ##x^2## and ##x^3## and you're going to be dealing with small differences between large numbers. It's mathematically correct and gives the right answer theoretically, but might lead to some round-off errors in actually evaluating.

The second form is in terms of the distance ##(x - t)## from the last point. It won't have the problem of numerical stability because ##(x - t)## will never get very large.

In fact I've often used a normalized parameter ##(x - x_i)/(x_{i+1}-x_i)## which ranges from 0 at the beginning of each interval to 1 at the end of the interval. I've found that makes the derivations and resulting equations extremely easy.

Since all of these things are linear in ##x##, if expanded and simplified they should all lead to the same polynomials given the same constraints.
 
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
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
6
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K