--- title: ANL Lista 14 tags: ANL author: Mateusz Reis --- # ANL LISTA 14 ## Zadanie 1 ![](https://i.imgur.com/wwj99wl.png) $$ A\widetilde{x}=\begin{bmatrix} 215.657\\ 252.428 \end{bmatrix}\\ A\widehat{x} =\begin{bmatrix} 216.999\\ 254 \end{bmatrix}\\ A\widetilde{x}-b = \begin{bmatrix} -1.343\\ -1.572 \end{bmatrix}=\widetilde{r}\\ A\widehat{x}-b = \begin{bmatrix} -0.001\\ 0 \end{bmatrix}=\widehat{r}\\ x= \begin{bmatrix} 1\\ -1 \end{bmatrix}\\ \widetilde{e}= \begin{bmatrix} -0,001\\ -0,001 \end{bmatrix}\\ \widehat{e}= \begin{bmatrix} -0,659\\ 0,913 \end{bmatrix} $$ Jak możemy zauważyć lepszym przybliżeniem jest $\widehat{x}$. Wniosek z tego to że obliczanie macierzy nie jest numerycznie poprawne bo dla lekko zaburzonych danych dostaliśmy dość mocno zaburzony wynik. ## Zadanie 2 ![](https://i.imgur.com/MRFarRs.png) Aby znaleźć rozkład LU uzyjemy metody ![](https://i.imgur.com/NWNaPmE.png) Po obliczeniach otrzymujemy: $$ L= \begin{bmatrix} 1&0&0&0\\ -2&1& 0&0\\ -3&4&1&0\\ -5&6&-7&1\\ \end{bmatrix}\\ U=\begin{bmatrix} 2 & 0 & 2 & 1 \\ 0 & 2 & 0 & 2\\ 0 & 0 & 2 & 0\\ 0 & 0 & 0& 2 \end{bmatrix} $$ Teraz szybko obliczymy $\det(A)$ $$ \det(A)=\det(L)*\det(U)=1*2^4=16 $$ Oraz odwrócimy $A$ $$ U^{-1}= \begin{bmatrix} 0.5& 0 &-0.5& -0.25\\ 0& 0.5& 0& -0.5\\ 0& 0& 0.5& 0\\ 0& 0& 0& 0.5 \end{bmatrix}\\ L^{-1}=\begin{bmatrix} 1 &0 &0 &0\\ 2 &1 &0 &0\\ -5 &-4 &1 &0\\ -42 &-34 &7 &1 \end{bmatrix}\\ A^{-1}=U^{-1}*L^{-1}= \begin{bmatrix} \frac{27}{2} &\frac{21}{2} &-\frac{9}{4} &-\frac{1}{4}\\ 22 &\frac{35}{2} &-\frac{7}{2} &-\frac{1}{2}\\ -\frac{5}{2} &-2 &\frac{1}{2} &0\\ -21 &-17 &\frac{7}{2} &\frac{1}{2} \end{bmatrix} $$ ## Zadanie 3 ![](https://i.imgur.com/tiehDGw.png) Rozbijamy $A$ na macierz $L$ i $U$: $$ L= \begin{bmatrix} 1 &0 & 0 & 0\\ -1 & 1 & 0 & 0 \\ -2 & 4 & 1 & 0\\ -3 & 5 & -6 & 1 \end{bmatrix} U= \begin{bmatrix} 1 & 1 & 1 & -10 \\ 0 & -2 & 1 & 1 \\ 0 & 0 & 3 & 1 \\ 0 & 0 & 0 & -4 \\ \end{bmatrix} $$ Teraz liczymy $Ly=b$ oraz $Ux=y$: $$ Ly= \begin{bmatrix} 1 &0 & 0 & 0\\ -1 & 1 & 0 & 0 \\ -2 & 4 & 1 & 0\\ -3 & 5 & -6 & 1 \end{bmatrix}* \begin{bmatrix} y_1\\ y_2\\ y_3\\ y_4 \end{bmatrix}= \begin{bmatrix} -6\\ 9\\ 31\\ -13 \end{bmatrix}\\ \begin{bmatrix} y_1\\ y_2\\ y_3\\ y_4 \end{bmatrix}= \begin{bmatrix} -6\\ 3\\ 7\\ -4 \end{bmatrix}\\ Ux= \begin{bmatrix} 1 & 1 & 1 & -10 \\ 0 & -2 & 1 & 1 \\ 0 & 0 & 3 & 1 \\ 0 & 0 & 0 & -4 \\ \end{bmatrix}* \begin{bmatrix} x_1\\ x_2\\ x_3\\ x_4 \end{bmatrix}= \begin{bmatrix} -6\\ 3\\ 7\\ -4 \end{bmatrix}\\ \begin{bmatrix} x_1\\ x_2\\ x_3\\ x_4 \end{bmatrix}= \begin{bmatrix} 2\\ 0\\ 2\\ 1 \end{bmatrix} $$