How Can I Find the Cubic Spline Function for This Data?

  • Thread starter Thread starter Lilia
  • Start date Start date
  • Tags Tags
    Function
Click For Summary
SUMMARY

The discussion focuses on finding the cubic spline function for the given data points (5, 1), (6, 3), and (9, 5). The user attempts to derive the cubic spline equations, specifically for segments s2 and s3, using the general cubic spline formula Sm(x,∆) = Pm,k(x) = a0k + a1k*x + ... + amk*x^m. The user correctly identifies the equations for s2 but encounters confusion regarding the number of variables and equations for s3, noting that they have 8 variables and only 5 equations. The user seeks clarification on the correctness of their equations and the next steps to resolve the issue.

PREREQUISITES
  • Understanding of cubic spline interpolation
  • Familiarity with polynomial equations
  • Knowledge of solving systems of equations
  • Basic calculus, particularly derivatives
NEXT STEPS
  • Review cubic spline interpolation methods in numerical analysis
  • Learn about the conditions for continuity and differentiability in spline functions
  • Study how to set up and solve systems of linear equations
  • Explore software tools like MATLAB or Python's SciPy for cubic spline implementation
USEFUL FOR

Students studying numerical methods, mathematicians, and anyone involved in data interpolation and curve fitting.

Lilia
Messages
47
Reaction score
0

Homework Statement


i need to find the cubic spline function for this data:
x: 5 6 9
y: 1 3 5

Homework Equations


Sm(x,∆) = Pm,k(x) = a0k + a1k*x + ... + amk*x^m

The Attempt at a Solution


s3 = a0 + a1*x + a2*x^2 + a3*x^3, [5,6]
b0 + b1*x + b2*x^2 + b3*x^3, [6,9]

in class we wrote s2(x, ∆) which is the same as above without the terms containing x^3 where there were 6 variables (a0, a1, a2, b0, b1, b2) and i got 5 equations by replacing x in above equations with 5,6,9. then replaced obe of the variables with constant: b2 = c, and thus found other 5 variables. here is the system of the equations for s2:
a0 + a1*5 + a2*5^2 = 1
a0 + a1*6 + a2*6^2 = 3
b0 + b1*6 + b2*6^2 = 3
b0 + b1*9 + b2*9^2 = 1
a1 + 2a2*x | {x=6} = b1 + 2b2*x | {x=6} // derivatives are equal in the middle point

what should i do here? i wrote the above equations for s3 too but, for s3 i have 8 variables and again 5 equations? how can this happen? are the equations correct?
 
Physics news on Phys.org
someone?
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 11 ·
Replies
11
Views
5K
Replies
14
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K