- #1
Lilia
- 48
- 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?