hw4: done 1,2,3,4
This commit is contained in:
parent
7aa38b7168
commit
ea73cb66aa
2 changed files with 99 additions and 0 deletions
BIN
hw4/hw4.pdf
BIN
hw4/hw4.pdf
Binary file not shown.
99
hw4/hw4.tex
99
hw4/hw4.tex
|
@ -75,4 +75,103 @@ $$a_2 = f[0,1,3] = \frac{2-(-3)}{3-0} = \frac{5}{3}$$
|
|||
$$p(x) = \left(\frac{5}{3}(x-1)-3\right) x + 0 = \frac{5}{3}x^2 - \frac{14}{3}x$$
|
||||
|
||||
The interpolating polynomials are indeed equal.
|
||||
|
||||
\section*{Question 4}
|
||||
\subsection*{Point a)}
|
||||
|
||||
The node coordinates to which fix the quadratic spline are $(1/2, y_0), (1, y_1),(3/2, y_2),(2, y_3)$.
|
||||
|
||||
Then, we can start formulating the equations for the linear system:
|
||||
|
||||
$$y_0 = s\left(\frac{1}{2}\right) = a_{-1}B_2\left(\frac{1}{2} + 1\right) + a_{0}B_2\left(\frac{1}{2}\right) + a_{1}B_2\left(\frac{1}{2} - 1\right) + $$$$
|
||||
+ a_{2}B_2\left(\frac{1}{2} - 2\right)
|
||||
+ a_{-1}B_2\left(\frac{1}{2} - 3\right)
|
||||
+ a_{0}B_2\left(\frac{1}{2} - 4\right)
|
||||
+ a_{1}B_2\left(\frac{1}{2} - 5\right)=$$$$
|
||||
a_{-1} \cdot 0 + a_{0} \cdot \frac{1}{2} + a_{1} \cdot \frac{1}{2} + a_{2} \cdot 0 + a_{-1} \cdot 0 + a_{0} \cdot 0 + a_{1} \cdot 0 = \frac{a_0 + a_1}{2}$$
|
||||
|
||||
$$y_1 = s\left(1\right) = a_{-1}B_2\left(1 + 1\right) + a_{0}B_2\left(1\right) + a_{1}B_2\left(1 - 1\right) + $$$$
|
||||
+ a_{2}B_2\left(1 - 2\right)
|
||||
+ a_{-1}B_2\left(1 - 3\right)
|
||||
+ a_{0}B_2\left(1 - 4\right)
|
||||
+ a_{1}B_2\left(1 - 5\right)=$$$$
|
||||
a_{-1} \cdot 0 + a_{0} \cdot \left(\frac{1}{8}\right) + a_{1} \cdot \frac{3}{4} + a_{2} \cdot \left(\frac{1}{8}\right) + a_{-1} \cdot 0 + a_{0} \cdot 0 + a_{1} \cdot 0 =
|
||||
\frac{1}{8} a_{0} + \frac{3}{4} a_{1} + \frac{1}{8} a_{2}$$
|
||||
|
||||
$$y_2 = s\left(\frac{3}{2}\right) = a_{-1}B_2\left(\frac{3}{2} + 1\right) + a_{0}B_2\left(\frac{3}{2}\right) + a_{1}B_2\left(\frac{3}{2} - 1\right) + $$$$
|
||||
+ a_{2}B_2\left(\frac{3}{2} - 2\right)
|
||||
+ a_{-1}B_2\left(\frac{3}{2} - 3\right)
|
||||
+ a_{0}B_2\left(\frac{3}{2} - 4\right)
|
||||
+ a_{1}B_2\left(\frac{3}{2} - 5\right)=$$$$
|
||||
a_{-1} \cdot 0 + a_{0} \cdot 0 + a_{1} \cdot \frac{1}{2} + a_{2} \cdot \frac{1}{2} + a_{-1} \cdot 0 + a_{0} \cdot 0 + a_{1} \cdot 0 = \frac{a_1 + a_2}{2}$$
|
||||
|
||||
$$y_3 = s\left(2\right) = a_{-1}B_2\left(2 + 1\right) + a_{0}B_2\left(2\right) + a_{1}B_2\left(2 - 1\right) + $$$$
|
||||
+ a_{2}B_2\left(2 - 2\right)
|
||||
+ a_{-1}B_2\left(2 - 3\right)
|
||||
+ a_{0}B_2\left(2 - 4\right)
|
||||
+ a_{1}B_2\left(2 - 5\right)=$$$$
|
||||
a_{-1} \cdot 0 + a_{0} \cdot 0 + a_{1} \cdot \left(\frac{1}{8}\right) + a_{2} \cdot \frac{3}{4} + a_{-1} \cdot \left(\frac{1}{8}\right) + a_{0} \cdot 0 + a_{1} \cdot 0 =
|
||||
\frac{1}{8} a_{1} + \frac{3}{4} a_{2} + \frac{1}{8} a_{-1}$$
|
||||
|
||||
The linear system in matrix form is:
|
||||
|
||||
\[\frac{1}{8} \cdot
|
||||
\begin{bmatrix}
|
||||
4&4&0&0\\
|
||||
1&6&1&0\\
|
||||
0&4&4&0\\
|
||||
0&1&6&1\\
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
a_0\\a_1\\a_2\\a_{-1}\\
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
y_0\\y_1\\y_2\\y_{3}\\
|
||||
\end{bmatrix}\]
|
||||
|
||||
The determinant of that matrix is 0 so the matrix is singular.
|
||||
|
||||
\subsection*{Point b)}
|
||||
|
||||
The node coordinates to which fix the quadratic spline are $(0, y_0), (1, y_1),(2, y_2),(3, y_3)$.
|
||||
|
||||
Then, we can start formulating the equations for the linear system:
|
||||
$$y_0 = s(0) = a_{-1}B_2\left(1\right) + a_{0}B_2\left(0\right) + a_{1}B_2\left(- 1\right) + $$$$
|
||||
+ a_{2}B_2\left(- 2\right)
|
||||
+ a_{-1}B_2\left(- 3\right)
|
||||
+ a_{0}B_2\left(- 4\right)
|
||||
+ a_{1}B_2\left(- 5\right)=$$$$
|
||||
a_{-1} \cdot \frac{1}{8} + a_{0} \cdot \frac{3}{4} + a_{1} \cdot \frac{1}{8} + a_{2} \cdot 0 + a_{-1} \cdot 0 + a_{0} \cdot 0 + a_{1} \cdot 0 =
|
||||
\frac{1}{8} a_{-1} + \frac{3}{4} a_{0} + \frac{1}{8} a_{1}$$
|
||||
|
||||
$$y_1 = s\left(1\right) = \frac{1}{8} a_{0} + \frac{3}{4} a_{1} + \frac{1}{8} a_{2}$$
|
||||
|
||||
$$y_2 = s\left(2\right) = \frac{1}{8} a_{1} + \frac{3}{4} a_{2} + \frac{1}{8} a_{-1}$$
|
||||
|
||||
$$y_3 = s\left(3\right) = a_{-1}B_2\left(3 + 1\right) + a_{0}B_2\left(3\right) + a_{1}B_2\left(3 - 1\right) + $$$$
|
||||
+ a_{2}B_2\left(3 - 2\right)
|
||||
+ a_{-1}B_2\left(3 - 3\right)
|
||||
+ a_{0}B_2\left(3 - 4\right)
|
||||
+ a_{1}B_2\left(3 - 5\right)=$$$$
|
||||
a_{-1} \cdot 0 + a_{0} \cdot 0 + a_{1} \cdot 0 + a_{2} \cdot \frac{1}{8} + a_{-1} \cdot \frac{3}{4} + a_{0} \cdot \frac{1}{8} + a_{1} \cdot 0 =
|
||||
\frac{1}{8} a_{2} + \frac{3}{4} a_{-1} + \frac{1}{8} a_{0}$$
|
||||
|
||||
The linear system in matrix form is:
|
||||
|
||||
\[\frac{1}{8} \cdot
|
||||
\begin{bmatrix}
|
||||
6&1&0&1\\
|
||||
1&6&1&0\\
|
||||
0&1&6&1\\
|
||||
1&0&1&6\\
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
a_0\\a_1\\a_2\\a_{-1}\\
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
y_0\\y_1\\y_2\\y_{3}\\
|
||||
\end{bmatrix}\]
|
||||
|
||||
\end{document}
|
||||
|
|
Reference in a new issue