Numerical analysis homework help>Least Squares and Fourier Series
x-values
y-values
-3.14159265358979
0.00000000000000
-2.81089869005402
-0.43702230525987
-2.48020472651826
-0.78170987707147
-2.14951076298249
-0.85207605602719
-1.81881679944672
-0.52335935447908
-1.48812283591095
0.22121102681686
-1.15742887237519
1.27130734031775
-0.82673490883942
2.41089249371528
-0.49604094530365
3.37539264122665
-0.16534698176788
3.92749194128624
0.16534698176788
3.92749194128624
0.49604094530365
3.37539264122665
0.82673490883942
2.41089249371528
1.15742887237519
1.27130734031775
1.48812283591095
0.22121102681686
1.81881679944672
-0.52335935447908
2.14951076298249
-0.85207605602719
2.48020472651826
-0.78170987707147
2.81089869005402
-0.43702230525987
3.14159265358979
0.00000000000000
We want to fit two Least Squares polynomials to the 20-point data on the left. Notice that the interval of interest is ??????. You will have to cut and paste the data into your computer program.
Part-I
Goal: Approximate the data by a 4th degree polynomial,
P4(x) = ao+ a1x+ a2x2+ a3x3+ a4x4 and write your coefficients in the space provided. Round your final answers to 4 decimal digits. Also plot the data points and the curve y= P4(x) together, in the spaces provided below. Do not connect the data points.
Part-II
Goal: Approximate the data by a Trig Polynomial,
S3(x)=a0/2+(a3/2)Cos3x+a1Cosx+a2Cos2x+b1Sinx+b2Sin2x and write your coefficients in the space provided. The final answers must be rounded to 4 decimal digits. Notice that the forms of ao and a3 are compatible with our book and well suited for Cooley-Tukey Fast Fourier Transform. Also plot the data points and the curve y= S3(x) together, in the spaces provided below. Do not connect the data points.
Your output/notes should be printed below:
(a) Print the Coefficients for Part-I here, rounded to 4 decimal digits:
ao =
a1=
a2=
a3=
a4=
(b) Print the Coefficients for Part-II here, rounded to 4 decimal digits:
=
a1=
a2=
=
b1=
b2=
(c) Plot the graph for Part-I here, For full credit, your graph should be labelled properly.
(d) Plot the graph for Part-II here, For full credit, your graph should be labelled properly.
e) Your notes for Part-I must be typed up here. Any assumptions, equations, techniques that you used.
f) Your notes for Part-II must be typed up here. Any assumptions, equations, techniques that you used.