Fit a trigonometric function of the form f(t)=c0+c1sin(t)+c2cos(t)f(t)=c0+c1sin⁡(t)+c2cos⁡(t) to the data points (0,5.5)(0,5.5), (π2,0.5)(π2,0.5), (π,−2.5)(π,−2.5), (3π2,−7.5)(3π2,−7.5), using least squares.

Respuesta :

Answer

[TeX]f(t)=-0.2+4.1sin(t)+4cos(t) [/TeX]

Step-By-Step Explanation

Given the function [TeX]f(t)=c_0+c_1sin(t)+c_2cos(t) [/TeX].

For each pair (t, f(t)) in the data points (0,5.5), (π/2,0.5), (π,−2.5), (3π/2,−7.5)

[TeX]f(0)=c_0+0c_1+c_2=5.5 [/TeX].

[TeX]f(\pi /2)=c_0+c_1+0c_2=0.5 [/TeX].

[TeX]f(\pi)=c_0+0sin(t)-c_2=-2.5 [/TeX].

[TeX]f(3\pi /2)=c_0-c_1+0c_2=-7.5 [/TeX].

Expressing this as a system of linear equations in matrix form AX=B

[TeX]\left(\begin{array}{ccc}   1 & 0 & 1 \\   1 & 1 & 0 \\   1 & 0 & -1 \\   0 & -1 & 0    \end{array}   \right)\left(   \begin{array}{c}   c_{0} \\   c_{1} \\   c_{2}\\   \end{array}   \right)=\left(\begin{array}{c}   5.5 \\   0.5 \\   -2.5 \\   -7.5    \end{array}   \right) [/TeX]      

Where    

[TeX]A=\left(\begin{array}{ccc}   1 & 0 & 1 \\   1 & 1 & 0 \\   1 & 0 & -1 \\   0 & -1 & 0    \end{array}   \right) [/TeX],      

[tex]B=\left(\begin{array}{c}5.5\\0.5\\-2.5\\-7.5\end{array} \right)[/tex]

[tex]X=\left(\begin{array}{c}c_0\\c_1\\c_2\end{array}\right)[/tex]     

To determine the values of X, we use the expression  

[TeX]X=(A^{T}A)^{-1}A^{T}B[/TeX]      

[TeX]A^{T}A= \left(\begin{array}{ccc}   3 & 1 & 0 \\   1 & 2 & 0 \\   0 & 0 & 2    \end{array}   \right) [/TeX]

[TeX] (A^{T}A)^{-1}= \left(\begin{array}{ccc}   0.4 & -0.2 & 0 \\   -0.2 & 0.6 & 0 \\   0 & 0 & 0.5    \end{array}   \right) [/TeX]      

[TeX]A^{T}B=\left(\begin{array}{c}   3.5 \\   8 \\   8    \end{array}   \right) [/TeX]      

Therefore:    

[TeX]X=\left(\begin{array}{ccc}   0.4 & -0.2 & 0 \\   -0.2 & 0.6 & 0 \\   0 & 0 & 0.5    \end{array}   \right)\left(   \begin{array}{c}   3.5 \\   8 \\   8    \end{array}   \right) [/TeX]      

[tex]X=\left(\begin{array}{c}c_0\\c_1\\c_2\end{array}\right)=\left(\begin{array}{c} -0.2 \\4.1\\4\end{array}\right)[/tex]  

Therefore, the trigonometric function which fits to the given data is:

[tex]f(t)=-0.2+4.1sin(t)+4cos(t)[/tex]

RELAXING NOICE
Relax