1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
\documentclass[a4paper]{article}
% Imports
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{ragged2e}
\usepackage{blindtext}
\usepackage[english]{babel} %this is the dictionary you will use
\usepackage{graphicx,mathdots,chemarr,fancyvrb,comment} %some more packages
\usepackage{tikz} %some more packages
%the packages from here on will help with creating a graph
%tikzpicture
\usepackage[many]{tcolorbox}
\usepackage{wrapfig}
\usepackage{scalerel}
\usepackage{pict2e}
\usepackage{tkz-euclide}
\usepackage{scalerel}
\usepackage{pict2e}
\usepackage{tkz-euclide}
\usepackage{listings}
\usepackage{color}
\usepackage{xifthen}
\usepackage{hyperref}
\usepackage{xstring} % for \IfStrEqCase
\newcounter{lemmacount}
\newcounter{proofcount}
\graphicspath{ {/home/butterdog/Documents/texassets/} }
\definecolor{dkgreen}{rgb}{0,0.6,0}
%\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{red}{HTML}{ffb3b3}
\definecolor{redbar}{HTML}{ff0000}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\definecolor{cyanbar}{HTML}{00bfff}
\definecolor{cyan}{HTML}{b3f0ff}
\definecolor{greenbar}{HTML}{00ff00}
\definecolor{green}{HTML}{8cd98c}
\definecolor{main}{HTML}{5989cf} % setting main color to be used
\definecolor{sub}{HTML}{cde4ff} % setting sub color to be used
\tcbset{
sharp corners,
colback = white,
before skip = 0.2cm, % add extra space before the box
after skip = 0.5cm % add extra space after the box
} % setting global options for tcolorbox
\makeatletter
\lstset{frame=tb,
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3
}
%My Custom Commands
\newcommand{\mnewline}{\newline\newline\newline}
\newcommand{\mline}{\rule{0.5cm}{0.5pt}}
\newcommand{\proj}[1]{\text{Proj}_{#1}}
\newcommand{\st}{\ni:}
\newcommand{\evaline}[2]{\Big|^{#1}_{#2}}
\newcommand{\nulli}[1]{\text{Null }{#1}}
\newcommand{\ran}[1]{\text{ran }{#1}}
\newcommand{\col}[1]{\text{Col }({#1})}
\newcommand{\re}[1]{\text{Re}({#1})}
\newcommand{\im}[1]{\text{Im}({#1})}
\newcommand{\spa}[1]{\text{span}\{{#1}\}}
\newcommand{\cvec}[1]{\underline{#1}}
%\newcommand{\neproof}[3]{$\text{Let } \epsilon > {#2} \text{ be given}$\\\text{Choose $N = {#1}$\text{ Suppose $n > N > {#3}$}}}
\newcommand{\neproof}[3]{ %The first one is without the 3rd argument and the second one is
\ifthenelse{\isempty{#3}}{$\text{Let } \epsilon > {#2} \text{ be given}$\\\text{Choose $N = {#1}$\text{ Suppose $n > N$}}}
{$\text{Let } \epsilon > {#2} \text{ be given}$\\\text{Choose $N = {#1}$\text{ Suppose $n > N > {#3}$}}}
}
\newcommand{\infobox}[2]{\begin{InfoBox}
\smash{\raisebox{-5pt}{\includegraphics[width=0.77cm,height=0.68cm]{information}}}{\bf #1}\newline\newline
{#2}
\end{InfoBox}}
\newcommand{\warningbox}[2]{\begin{WarningBox}
\smash{\raisebox{-6pt}{\includegraphics[width=0.70cm,height=0.70cm]{warning}}}
{\bf #1}\newline\newline
{#2}
\end{WarningBox}}
\newcommand{\theorybox}[2]{\begin{TheoryBox}
\smash{\raisebox{-6pt}{\includegraphics[width=0.70cm,height=0.70cm]{theorem}}}
{\bf #1}\newline\newline
{#2}
\end{TheoryBox}}
\newcommand{\notebox}[2]{\begin{NoteBox}
\smash{\raisebox{-6pt}{\includegraphics[width=0.55cm,height=0.70cm]{reminder}}}
{\bf #1}\newline\newline
{#2}
\end{NoteBox}}
\newcommand{\proofbox}[3]{%
\IfStrEqCase{#1}{%
{lemma}{\stepcounter{lemmacount}\def\proofboxlabel{Lemma \thelemmacount}}%
{proof}{\stepcounter{proofcount}\def\proofboxlabel{Proof \theproofcount}}%
}[\PackageError{proofbox}{Unknown proofbox type '#1'}{Use 'lemma' or 'proof'}]%
\begin{ProofBox}
\IfStrEq{#2}{}%
{{\bf \proofboxlabel:}}%
{{\bf \proofboxlabel\ (#2):}}%
\newline\newline
{#3}
\end{ProofBox}
}
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\newtcolorbox{InfoBox}{
colback = sub,
colframe = main,
boxrule = 0pt,
leftrule = 6pt % left rule weight
}
\newtcolorbox{WarningBox}{
colback = red,
colframe = redbar,
boxrule = 0pt,
leftrule = 6pt % left rule weight
}
\newtcolorbox{TheoryBox}{
colback = cyan,
colframe = cyanbar,
boxrule = 0pt,
leftrule = 6pt % left rule weight
}
\newtcolorbox{NoteBox}{
colback = green,
colframe = greenbar,
boxrule = 0pt,
leftrule = 6pt % left rule weight
}
\newtcolorbox{TitleBox}{
boxrule = 2pt,
rounded corners
}
\newtcolorbox{ProofBox}{
boxrule = 1.3pt,
}
\makeatother
\usepackage[letterpaper,left=6mm,includemp=true,marginparwidth=12mm,marginparsep=1mm,reversemarginpar,right=19mm,
includefoot=true,top=19mm,nohead,footskip=12mm,bottom=6mm]{geometry}
% Here are the custom commands I have created. They are increadibly retarded
% mnewline: creates 3 newlines
% mline: Creates a horizontal line
% proj: Creates a Proj with a suitable subscript - Takes an argument
% st: creates a ni and a : as the 'such that'
% evaline: creates a vertical line for evaluated definite integrals. First argument is upper limit, second is lower. - Takes two arguments
% nulli: creates a Null (with a whitespace) - Takes an argument
% col: creates a Col (with a whitespace) - Takes an argument
% ran: creates a ran (with a whitespace) - Takes an argument
% re: creates a Re() - Takes an argument
% im: creates a Im() - Takes an argument
% sp: creates a span{} - Takes an argument
% neproof: Creates a cookie cutter N-epsilon proof. First argument set's N's value and second argument sets epsilon greater than value and the third (optional) argument sets the n > N > value. IF YOU DO NOT WANT THE THIRD ARGUMENT YOU NEED AN EMPTY CURLY BRACKET
\begin{document}
\setlength{\parindent}{1cm}
\begin{center}
{\bf \Large CSCC37}
\end{center}
\begin{TitleBox}
\begin{center}
{\bf Main Notes}
\end{center}
\end{TitleBox}
\tableofcontents
\pagebreak
\section{Floating Point Arithmetic}
\subsection{Overview}
A broad overview of this chapter is studying how computers represent real numbers and how we manipulate them. This is because while some real numbers are much easier, like integers, dealing with irrational values, even just seemingly simple decimal values like $0.1$ can be challenging. Often when dealing with floating point values we deal with issues such as rounding or even chopping, which lead to round off error, and can subsequently lead to error propagation. For example, if we have a computer that can only handle four digit floating point values, and we subtract $0.1234367$ and $0.1234216$, we would expect something like $1.51*10^{-4}$, but because our computer can only do four digits, we actually get $0$. While this may seem close enough, ``close enough'' is relative. If we are only dealing with very small values, this is a massive issue.\\
\theorybox{Definition -- Conditioning/Stability}{These two both refer to how we measure how small changes in the initial input impact the final result. While both do this, they apply to different things. Conditioning applies specifically to functions, where we say the condition of $f$ or $\text{cond}(f)$. Stability meanwhile refers to algorithms where we can have multiple inputs and outputs. The value is always a number that indicates the amplification of the impact.}
\pagebreak
\section{Solving Linear Systems of Equations}
\subsection{Overview}
\notebox{Notation}{$A$ in this context refers to a square matrix. We should only be handling square matrices because non-squares are handled in the next course. Row/Column vectors are denoted with an underline such as $\underline{x}$ or $\underline{b}$.\\\\
When referring to the triangular matrices, we use $\triangle^r$. Refer to B24 notes for definitions on what is an upper/lower (strict) matrix.}
Here we will be exploring how to solve these systems, how error propagation affects them and how to control the error propagation.\\
\infobox{Review Linear Algebra}{Review concepts such as triangular matrices, square matrices and their properties.}
\subsection{Direct Method}
So as a recap, our problem is $A\cvec{x} = \cvec{b}$. We know $A$ and $\cvec{b}$, and we want to solve for $\cvec{x}$.
\infobox{Do you want to learn more?}{This is the method that Pancer is using for this course. More information can be found in the textbook Scientific Computing: An Introductory Survey.}
The direct method is the method already introduced in A22 but with some extra steps. Remember that while the process might be like ``why do it like this, why these inbetweener steps'', its all to simplify the calculations.\\
\begin{enumerate}
\item Factorize $A$\\
We will factorize $A = LU$, where $L$ is a unit lower $\triangle^r$ and $V$ is an upper $\triangle^r$.
\notebox{Why are they square}{$L$ and $U$ don't necessarily have to be square, but as you will see in the later steps, it helps that they are.}
Note that by doing this, we have turned $A$, which is an unstructured matrix that is likely dense, into two highly structured matrices.
\item Restate the problem\\
So now:
\begin{equation}
A\cvec{x} = \cvec{b} \iff LU\cvec{x} = \cvec{b}
\end{equation}
\item Next, we will do a change of variable and make
\begin{equation}
L\cvec{d} = \cvec{b}
\end{equation}
Where
\begin{equation}
\cvec{d} = U\cvec{x}
\end{equation}
\item Next, solve for $\cvec{d}$.
So if we expand we will have something like:
\begin{equation}
\left[
\begin{array}{cccc}
1&&&0\\
\ell_{21}&1&&\\
\vdots&&\ddots&\\
\ell_{n1}&\cdots&&1\\
\end{array}
\right]
\left[
\begin{array}{c}
d_1\\
d_2\\
\vdots\\
d_n
\end{array}
\right]
=
\left[
\begin{array}{c}
d_1\\
\ell_{21}d_1 + d_2\\
\vdots\\
\vdots\\
\end{array}
\right]
=
\left[
\begin{array}{c}
b_1\\
b_2\\
\vdots\\
\vdots\\
\end{array}
\right]
\end{equation}
Which honestly is not too bad, second result depends on first, third on second, etc. It just unfolds like that.\\
If this looks confusing, {\it remember} that we have $\ell_{ii}$ and we have $b_i$. We just have to work our way down. This is called {\bf forward elimination}.
\item Then solve $U\cvec{x} = \cvec{d}$ for $\cvec{x}$. We have to do this because the point is not to solve $D$, but to solve $\cvec{x}$.
\begin{equation}
\left[
\begin{array}{cccc}
u_{11} > 0&&\cdots&u_{1n} > 0\\
0&u_{22}>0&&\\
\vdots &&\ddots&\\
0&\cdots&\cdots&u_{nn} > 0\\
\end{array}
\right]
\left[
\begin{array}{c}
x_1\\
\vdots\\
x_n
\end{array}
\right]
=
\left[
\begin{array}{c}
d_1\\
\vdots\\
d_n
\end{array}
\right]
\end{equation}
And from this it is obvious that $x_n = \frac{d_n}{u_{nn}}$. And thus we can calculate $x_i$. Here we have to work our way up as opposed to step 4 where we worked down. this is called {\bf backwards substitution}.
\end{enumerate}
Just note that this process has a lot of error propagation. One of the reasons is because this algorithm has a runtime of $\mathcal{O}(n^3)$ and as we run more, we perform more operations which causes more rounding or chopping. This will be elaborated on later.
\subsection{Indirect Method}
\theorybox{Definition -- X-Test}{TBA}
\theorybox{Definition -- F-Test}{TBA}
\subsection{Iterative Refinement/Improvement}
\pagebreak
\section{Solving Non-linear Single Equations}
\subsection{Overview}
For this section we are only doing single equations because doing multiple requires knowledge of multivariable calculus (and fuck that shit).\\
Non-linear problems are harder because of the fact that we don't always know how many solutions there will be.
\theorybox{Definition -- Fixed Point Problem -- FPP}{The FPP relates directly with the FPI, or Fixed Point Iteration}
\theorybox{Definition -- Fixed Point Iteration -- FPI}{TBA}
\pagebreak
\end{document}
|