Numerical Methods

154_Cubic Splines

elif 2024. 5. 2. 22:18

In this post, I'll solve the same example as in the previous post using the cubic spline process derived in the last posting. The first step is to generate a set of simultaneous equations to determine the second derivatives at the nodes. For example, the following data is used for the first internal node.

 

 

When these values are substituted into the equation, it results in the following.

 

 

 

 

Due to the natural spline condition, the equation can be simplified as follows.

 

 

Similarly, when applied to the second internal point, the calculation can be done as follows.

 

 

These two equations can be solved simultaneously in the following case.

 

 

By substituting these values into the equation, the following results can be derived.

 

 

This equation is the cubic spline for the first interval. Similarly, by substituting appropriate values, the equations for the second and third intervals can be calculated.

 

 

These three equations can be used to calculate values within each interval. For example, the value at $x=5$, which lies in the second interval, can be calculated as follows.

 

 

 

'Numerical Methods' 카테고리의 다른 글

156_Trapezoidal Rule  (0) 2024.05.04
155_Least Squares Fit  (0) 2024.05.03
153_Quadratic Splines  (0) 2024.05.01
152_Derivation of Cubic Splines  (0) 2024.04.30
151_Lagrange Interpolation Polynomials  (0) 2024.04.29