Coefficient Matrix Of Cubic Spline Interpolation.

Click For Summary
SUMMARY

The discussion focuses on deriving the coefficient matrix (a) for a parabolically terminated cubic spline interpolation. The coefficients a_i (where i ranges from 1 to n) are determined using a tridiagonal matrix M, which incorporates specific end conditions. For natural cubic splines, the conditions are a_1 = 0 and a_n = 0, while for the parabolically terminated cubic spline, the conditions change to -a_1 + a_2 = 0 and -a_{n-1} + a_n = 0. The matrix M and vector d must be adjusted accordingly to reflect these new conditions.

PREREQUISITES
  • Cubic spline interpolation
  • Tridiagonal matrix systems
  • Linear algebra concepts
  • Matrix representation of linear equations
NEXT STEPS
  • Study the derivation of cubic spline coefficients in detail
  • Learn about tridiagonal matrix algorithms for solving linear systems
  • Explore the differences between natural and parabolically terminated cubic splines
  • Investigate numerical methods for spline interpolation
USEFUL FOR

Mathematicians, data scientists, and engineers involved in numerical analysis and interpolation techniques will benefit from this discussion.

SherlockOhms
Messages
309
Reaction score
0

Homework Statement


I'm trying to derive the coefficient matrix (a) of a parabolically terminated cubic spline. This is the matrix of coefficients ##a_i \rightarrow a_n## where n is the number of data points provided.

With this matrix you can find all the other coefficients (b and c) that define the spline using: $$b_i = \frac{y_i}{h_i} - a_i h_i$$ where ##y_i## is the corresponding value of the given set of y values and ##h_i## is defined as ##x_{i + 1} - x_i##.

The ##a## coefficients (n in total) satisfy the following n - 2 linear equations: $$h_1 a_i + 2(h_{i + 1} + h_i)a_{i + 1} + h_{i + 1}a_{i + 1} = \frac{y_{i + 2} - y_{i + 1}}{h_{i + 1}} - \frac{y_{i + 1} - y_i}{h_i}$$

So, you have n coefficients and n - 2 equations. Therefore, you need 2 extra equations to be able to solve the system.

For a natural cubic spline these end conditions are ##a_1## = 0 and ##a_n## = 0. So, you can then write the system in the form: ##Ma = d##. Where, ##M## is a tridiagonal matrix of ##h_i## along it's sub diagonal (n - 1 in length), ##h_{i + 1}## along it's super diagonal (n - 1 in length) and ## 2(h_{i + 1} + h_i)## along it's main diagonal (n in length). Thus an n x n matrix is produced. Then ##a## is the coefficient matrix of ##a_i \rightarrow a_n## (n x 1) and ##d## is the n x 1 vector filled with ## \frac{y_{i + 2} - y_{i + 1}}{h_{i + 1}} - \frac{y_{i + 1} - y_i}{h_i}##. Incorporating the extra conditions in, the first and last rows of matrix M will be 1 0 0 ... and ...0 0 0 1 respectively. As well as the first and last rows of the vector ##d## being 0. This ensures that ##a_1## and ##a_n## = 0.

So, my question is, when writing this linear system for a parabolically terminated cubic spline in matrix form, who's end conditions are ##-a_1 + a_2 = 0## and ##-a_{n-1} + a_n = 0##, how do the first and last rows of M and d change? I've outlined above how the matrices are set up for the given conditions ##a_1## = 0 and ##a_n## = 0, and I just wnat to know how they change with these new conditions.



Homework Equations


All above.


The Attempt at a Solution


All above.
 
Physics news on Phys.org
SherlockOhms said:

Homework Statement


I'm trying to derive the coefficient matrix (a) of a parabolically terminated cubic spline. This is the matrix of coefficients ##a_i \rightarrow a_n## where n is the number of data points provided.

With this matrix you can find all the other coefficients (b and c) that define the spline using: $$b_i = \frac{y_i}{h_i} - a_i h_i$$ where ##y_i## is the corresponding value of the given set of y values and ##h_i## is defined as ##x_{i + 1} - x_i##.

The ##a## coefficients (n in total) satisfy the following n - 2 linear equations: $$h_1 a_i + 2(h_{i + 1} + h_i)a_{i + 1} + h_{i + 1}a_{i + 1} = \frac{y_{i + 2} - y_{i + 1}}{h_{i + 1}} - \frac{y_{i + 1} - y_i}{h_i}$$

So, you have n coefficients and n - 2 equations. Therefore, you need 2 extra equations to be able to solve the system.

For a natural cubic spline these end conditions are ##a_1## = 0 and ##a_n## = 0. So, you can then write the system in the form: ##Ma = d##. Where, ##M## is a tridiagonal matrix of ##h_i## along it's sub diagonal (n - 1 in length), ##h_{i + 1}## along it's super diagonal (n - 1 in length) and ## 2(h_{i + 1} + h_i)## along it's main diagonal (n in length). Thus an n x n matrix is produced. Then ##a## is the coefficient matrix of ##a_i \rightarrow a_n## (n x 1) and ##d## is the n x 1 vector filled with ## \frac{y_{i + 2} - y_{i + 1}}{h_{i + 1}} - \frac{y_{i + 1} - y_i}{h_i}##. Incorporating the extra conditions in, the first and last rows of matrix M will be 1 0 0 ... and ...0 0 0 1 respectively. As well as the first and last rows of the vector ##d## being 0. This ensures that ##a_1## and ##a_n## = 0.

So, my question is, when writing this linear system for a parabolically terminated cubic spline in matrix form, who's end conditions are ##-a_1 + a_2 = 0## and ##-a_{n-1} + a_n = 0##, how do the first and last rows of M and d change? I've outlined above how the matrices are set up for the given conditions ##a_1## = 0 and ##a_n## = 0, and I just wnat to know how they change with these new conditions.



Homework Equations


All above.


The Attempt at a Solution


All above.

You have already said how the first and last row change: instead of a1 = 0 you have a1-a2=0, and instead of a_n = 0 you have a_(n-1)-a_n = 0.
 
Think I've already got it sorted. Thanks for the reply.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K