Constructing a linear and a cubic spline. Given the data set: a). Let L(x) be th
ID: 3109205 • Letter: C
Question
Constructing a linear and a cubic spline. Given the data set: a). Let L(x) be the linear spline that interpolates the data. Describe what L(x) consists of, and what conditions it has to satisfy. Find L(x), and compute the value for L( 1.8). b). Let C(x) be the natural cubic spline that interpolates the data. Describe what C(x) consists of. and what conditions it has to satisfy. Find C(x), and compute the value for C(1.8). The computation here can be time consuming, and you may use Matlab to solve the linear system.Explanation / Answer
1)
Linear spline in data point between 1.6 and 2.0
is defined as
Y = ax+b
putting first conditions
0.8736= a1.6 + b
putting 2nd conditions
-0.9751 = 2 a +b
solving avove two equation in matlab we get
a=-4.622 b=8.268
y=-4.622x+8.268
y(1.8) = -4.622x1.8+8.268 =-0.0516
2)
using cubic spline interpolation
y=a_0 + a_1x+a_2x^2+a_3x^3
puuting first conditions
a_0 + 1.5 a_1+1.5^2a_2+1.5^3 a_3=1.139
putting 2nd 3rd and 4th conditions
a_0 + 1.56a_1+1.6^2a_2+1.6^3 a_3=0.8736
a_0 + 2 a_1+2^2a_2+2^3 a_3=-0.9751
a_0 + 2.2 a_1+2.2^2a_2+2.2^3 a_3=-0.1536
solving these equation in matlab
a_0=-131.0743
a_1= 236.6383
a_2=-138.6065
a_3= 26.4061
therefore
y(1.8) = -131.0743 + 236.683*1.8-138.6065 *1.8^2+26.4061*1.8^3=-0.-0.2102
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.