2020-04-19 15:25:55 +00:00
% vim: set ts=2 sw=2 et tw=80:
\documentclass [12pt,a4paper] { article}
\usepackage [utf8] { inputenc} \usepackage [margin=2cm] { geometry}
\usepackage { amstext} \usepackage { amsmath} \usepackage { array}
\newcommand { \lra } { \Leftrightarrow }
\title { Howework 3 -- Introduction to Computational Science}
\author { Claudio Maggioni}
\begin { document} \maketitle
\section * { Question 1}
2020-04-21 08:36:27 +00:00
\[ i = 1 \hspace { 1 cm } l _ 1 = \begin { bmatrix } 1 \\ 1 \\ 5 \\ - 3 \\ \end { bmatrix } \hspace { 1 cm } u _ 1 = \begin { bmatrix }
2 & 1 & 1 & -2 \\ \end { bmatrix} \]
\[ A _ 2 = \begin { bmatrix }
2 & 1 & 1 & -2 \\ 2 & 2 & -2 & -1 \\ 10 & 4 & 23 & -8 \\
-6 & -2 & 4 & 6 \\ \end { bmatrix} - \begin { bmatrix}
2 & 1 & 1 & -2 \\ 2 & 1& 1 & -2 \\ 10 & 5 & 5 & -10 \\ -6 & -3 & -3 & 6 \\ \end { bmatrix} = \begin { bmatrix} \\ & 1 & -3 & 1 \\ & -1 & 18 & 2 \\ & 1 & 7 & 0 \end { bmatrix} \]
\[ i = 2 \hspace { 1 cm } l _ 2 = \begin { bmatrix } \\ 1 \\ - 1 \\ 1 \\ \end { bmatrix } \hspace { 1 cm } u _ 2 = \begin { bmatrix } & 1 & - 3 & 1 \\ \end { bmatrix } \]
\[ A _ 3 = \begin { bmatrix } \\ & 1 & - 3 & 1 \\ & - 1 & 18 & 2 \\ & 1 & 7 & 0 \end { bmatrix } - \begin { bmatrix } \\ & 1 & - 3 & 1 \\ & - 1 & 3 & - 1 \\ & 1 & - 3 & 1 \\ \end { bmatrix } = \begin { bmatrix }
\\
\\
& & 15& 3\\ & & 10& -1\\ \end { bmatrix} \]
\[ i = 3 \hspace { 1 cm } l _ 3 = \begin { bmatrix } \\ \\ 1 \\ 2 / 3 \\ \end { bmatrix } \hspace { 1 cm } u _ 3 = \begin { bmatrix } & & 15 & 3 \\ \end { bmatrix } \]
\[ A _ 4 = \begin { bmatrix }
\\
\\
& & 15& 3\\ & & 10& -1\\ \end { bmatrix} - \begin { bmatrix} \\ \\ & & 15 & 3 \\ & & 10 & 2 \\ \end { bmatrix} = \begin { bmatrix} \\ \\ \\ & & & -3\\ \end { bmatrix} \]
\[ i = 4 \hspace { 1 cm } l _ 4 = \begin { bmatrix } \\ \\ \\ 1 \\ \end { bmatrix } \hspace { 1 cm } u _ 4 = \begin { bmatrix } & & & - 3 \\ \end { bmatrix } \]
\[ L = \begin { bmatrix } 1 \\ 1 & 1 \\ 5 & - 1 & 1 \\ - 3 & 1 & 2 / 3 & 1 \\ \end { bmatrix } \hspace { 1 cm } U = \begin { bmatrix } 2 & 1 & 1 & - 2 \\ & 1 & - 3 & 1 \\ & & 15 & 3 \\ & & & - 3 \\ \end { bmatrix } \]
\[ Ly = B \Rightarrow \begin { bmatrix } 1 \\ 1 & 1 \\ 5 & - 1 & 1 \\ - 3 & 1 & 2 / 3 & 1 \\ \end { bmatrix } \begin { bmatrix } y _ 1 \\ y _ 2 \\ y _ 3 \\ y _ 4 \\ \end { bmatrix } = \begin { bmatrix } - 1 \\ - 3 \\ 36 \\ 18 \\ \end { bmatrix }
\]
\[ y _ 1 = - 1 \]
\[ y _ 2 = - 3 - ( - 1 ) \cdot 1 = - 2 \]
\[ y _ 3 = 36 - 1 \cdot 2 - ( - 1 ) \cdot 5 = 39 \]
\[ y _ 4 = 18 - \frac { 2 } { 3 } \cdot 39 - ( - 2 ) - ( - 3 ) \cdot ( - 1 ) = - 9 \]
\[ Ux = Y \Rightarrow \begin { bmatrix } 2 & 1 & 1 & - 2 \\ & 1 & - 3 & 1 \\ & & 15 & 3 \\ & & & - 3 \\ \end { bmatrix } \begin { bmatrix } x _ 1 \\ x _ 2 \\ x _ 3 \\ x _ 4 \\ \end { bmatrix } = \begin { bmatrix } - 1 \\ - 2 \\ 39 \\ - 9 \\ \end { bmatrix }
\]
\[ x _ 4 = 3 \]
\[ x _ 3 = \frac { 39 - 3 - 3 } { 15 } = 2 \]
\[ x _ 2 = \frac { - 2 - 3 - ( - 3 ) \cdot 2 } { 1 } = 1 \]
\[ x _ 1 = \frac { - 1 - ( - 2 ) \cdot 3 - 1 \cdot 2 - 1 \cdot 1 } { 2 } = 1 \]
\[ x = \begin { bmatrix } 1 \\ 1 \\ 2 \\ 3 \\ \end { bmatrix } \]
2020-04-19 15:25:55 +00:00
\section * { Question 2}
\[ i = 1 \hspace { 1 cm } k = 4 \hspace { 1 cm } \begin { bmatrix } 4 & 2 & 3 & 1 \\ \end { bmatrix } \]
\[
l_ 1 =
\begin { bmatrix}
1/8 \\
1/4 \\
1/2 \\
1 \\
\end { bmatrix}
\hspace { 1cm}
u_ 1 = \begin { bmatrix} 32 & 24 & 10 & 11\end { bmatrix}
\hspace { 1cm}
\] \[
A_ 2 = \begin { bmatrix} 4 & 3 & 2& 1\\ 8& 8& 5& 2\\ 16& 12& 10& 5\\ 32& 24& 20 & 11 \\ \end { bmatrix} - \begin { bmatrix}
4 & 3 & 5/2 & 11/8 \\
8 & 6 & 5 & 11/4 \\
16 & 12 & 10 & 11/2 \\
32 & 24 & 20 & 11 \\
\end { bmatrix} =
\begin { bmatrix}
0 & 0 & -1/2 & -3/8 \\
0 & 2 & 0 & -3/4 \\
0 & 0 & 0 & -1/2 \\
0 & 0 & 0 & 0 \\
\end { bmatrix}
\]
\[ i = 2 \hspace { 1 cm } k = 2 \hspace { 1 cm } p = \begin { bmatrix } 4 & 2 & 3 & 1 \\ \end { bmatrix } \]
\[
l_ 2 =\begin { bmatrix}
0\\ 1\\ 0\\ 0\\
\end { bmatrix}
\hspace { 1cm}
u_ 2 =\begin { bmatrix} 0 & 2 & 0 & -3/4 \end { bmatrix} \]
\[
A_ 3 = \begin { bmatrix}
0 & 0 & -1/2 & -3/8 \\
0 & 2 & 0 & -3/4 \\
0 & 0 & 0 & -1/2 \\
0 & 0 & 0 & 0 \\
\end { bmatrix} -
\begin { bmatrix}
0 & 0 & 0 & 0 \\
0 & 2 & 0 & -3/4 \\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 \\
\end { bmatrix}
=
\begin { bmatrix}
0 & 0 & -1/2 & -3/8 \\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & -1/2 \\
0 & 0 & 0 & 0 \\
\end { bmatrix}
\]
\[ i = 3 \hspace { 1 cm } k = 4 \hspace { 1 cm } p = \begin { bmatrix }
4& 2& 1& 3\\
\end { bmatrix}
\]
\[
l_ 3 = \begin { bmatrix}
1 \\ 0\\ 0\\ 0\\
\end { bmatrix}
\hspace { 1cm}
u_ 3 = \begin { bmatrix} 0 & 0& -1/2 & -3/8\\ \end { bmatrix}
\] \[
A_ 4 = \begin { bmatrix}
0 & 0 & -1/2 & -3/8 \\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & -1/2 \\
0 & 0 & 0 & 0 \\
\end { bmatrix} -
\begin { bmatrix}
0 & 0 & -1/2& -3/8\\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 \\
\end { bmatrix} =
\begin { bmatrix}
0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & -1/2 \\
0 & 0 & 0 & 0 \\
\end { bmatrix}
\]
\[ i = 4 \hspace { 1 cm } k = 4 \hspace { 1 cm } p = \begin { bmatrix }
4& 2& 1& 3\\
\end { bmatrix} \]
\[ l _ 4 = \begin { bmatrix } 0 \\ 0 \\ 1 \\ 0 \\ \end { bmatrix }
u_ 4 = \begin { bmatrix} 0& 0& 0& -1/2\end { bmatrix}
\]
\[
P =
\begin { bmatrix}
0 & 0 & 0 & 1 \\
0 & 1 & 0 & 0 \\
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
\end { bmatrix}
\]
\[
L = P *
\begin { bmatrix}
1/8 & 0 & 1 & 0 \\
1/4 & 1 & 0 & 0 \\
1/2 & 0 & 0 & 1 \\
1 & 0 & 0 & 0 \\
\end { bmatrix}
=
\begin { bmatrix}
1 & 0 & 0 & 0 \\
1/4 & 1 & 0 & 0 \\
1/8 & 0 & 1 & 0 \\
1/2 & 0 & 0 & 1 \\
\end { bmatrix}
\]
\[
U =
\begin { bmatrix}
32 & 24 & 20 & 11 \\
0 & 2 & 0 & -3/4 \\
0 & 0 & -1/2 & -3/8 \\
0 & 0 & 0 & -1/2 \\
\end { bmatrix}
\]
2020-04-22 11:51:42 +00:00
\section * { Question 4}
A =
1 4 8 3
4 20 40 28
8 40 89 71
3 28 71 114
ans =
1
4
8
3
S =
1 4 8 3
4 16 32 12
8 32 64 24
3 12 24 9
A =
0 0 0 0
0 4 8 16
0 8 25 47
0 16 47 105
ans =
0
2
4
8
S =
0 0 0 0
0 4 8 16
0 8 16 32
0 16 32 64
A =
0 0 0 0
0 0 0 0
0 0 9 15
0 0 15 41
ans =
0
0
3
5
S =
0 0 0 0
0 0 0 0
0 0 9 15
0 0 15 25
A =
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 16
ans =
0
0
0
4
2020-04-19 15:25:55 +00:00
\end { document}