diff --git a/semester3/numcs/numcs-summary.pdf b/semester3/numcs/numcs-summary.pdf index e0d8c42..a722c8d 100644 Binary files a/semester3/numcs/numcs-summary.pdf and b/semester3/numcs/numcs-summary.pdf differ diff --git a/semester3/numcs/numcs-summary.tex b/semester3/numcs/numcs-summary.tex index de2d741..07bbfde 100644 --- a/semester3/numcs/numcs-summary.tex +++ b/semester3/numcs/numcs-summary.tex @@ -62,15 +62,28 @@ % ╭────────────────────────────────────────────────╮ % │ Main content │ % ╰────────────────────────────────────────────────╯ + +% ── Introduction ──────────────────────────────────────────────────── \newsection \section{Einführung} -\input{parts/introduction/rounding-errors.tex} -\input{parts/introduction/time-complexity.tex} -\input{parts/introduction/matrix-multiplication.tex} +\input{parts/00_introduction/00_rounding-errors.tex} +\input{parts/00_introduction/01_time-complexity.tex} +\input{parts/00_introduction/02_matrix-multiplication.tex} + +% ── polynomial interpolation ──────────────────────────────────────── +\newsection +\section{Polynomiale Interpolation} +\input{parts/01_interpolation/00_polynomial/00_intro.tex} +\input{parts/01_interpolation/00_polynomial/01_monome.tex} +\input{parts/01_interpolation/00_polynomial/02_newton-basis.tex} +\input{parts/01_interpolation/00_polynomial/03_barzycentric-formula.tex} +\input{parts/01_interpolation/00_polynomial/04_chebychev-interpolation.tex} -\input{parts/interpolation.tex} -\input{parts/fourier.tex} +% ── trigonometric interpolation ───────────────────────────────────── +\newsection +\section{Trigonometrische Interpolation} +\input{parts/01_interpolation/01_trigonometric/00_intro.tex} \end{document} diff --git a/semester3/numcs/parts/introduction/rounding-errors.tex b/semester3/numcs/parts/00_introduction/00_rounding-errors.tex similarity index 100% rename from semester3/numcs/parts/introduction/rounding-errors.tex rename to semester3/numcs/parts/00_introduction/00_rounding-errors.tex diff --git a/semester3/numcs/parts/introduction/time-complexity.tex b/semester3/numcs/parts/00_introduction/01_time-complexity.tex similarity index 100% rename from semester3/numcs/parts/introduction/time-complexity.tex rename to semester3/numcs/parts/00_introduction/01_time-complexity.tex diff --git a/semester3/numcs/parts/introduction/matrix-multiplication.tex b/semester3/numcs/parts/00_introduction/02_matrix-multiplication.tex similarity index 100% rename from semester3/numcs/parts/introduction/matrix-multiplication.tex rename to semester3/numcs/parts/00_introduction/02_matrix-multiplication.tex diff --git a/semester3/numcs/parts/01_interpolation/00_polynomial/00_intro.tex b/semester3/numcs/parts/01_interpolation/00_polynomial/00_intro.tex new file mode 100644 index 0000000..bad5dd7 --- /dev/null +++ b/semester3/numcs/parts/01_interpolation/00_polynomial/00_intro.tex @@ -0,0 +1,37 @@ +Bei der Interpolation versuchen wir eine Funktion $\tilde{f}$ durch eine Menge an Datenpunkten einer Funktion $f$ zu finden.\\ +Die $x_i$ heissen Stützstellen/Knoten, für welche $\tilde{f}(x_i) = y_i$ gelten soll. (Interpolationsbedingung) +\begin{align*} + \begin{bmatrix} + x_0 & x_1 & \ldots & x_n \\ + y_0 & y_1 & \ldots & y_n + \end{bmatrix}, + \quad x_i, y_i \in \mathbb{R} +\end{align*} + +Normalerweise stellt $f$ eine echte Messung dar, d.h. macht es Sinn anzunehmen dass $f$ glatt ist. + +Die informelle Problemstellung oben lässt sich durch Vektorräume formalisieren: + +$f \in \mathcal{V}$, wobei $\mathcal{V}$ ein Vektorraum mit $\dim(\mathcal{V}) = \infty$ ist. \\ +Wir suchen d.h. $\tilde{f}$ in einem Unterraum $\mathcal{V}_n$ mit endlicher $\dim(\mathcal{V}_n) = n$. +Sei $B_n = \{b_1,\ldots,b_n\}$ eine Basis für $\mathcal{V}_n$. +Dann lässt sich der Bezug zwischen $f$ und $\tilde{f} = f_n(x)$ so ausdrücken: +\begin{align*} + f(x) \approx f_n(x) = \sum_{j=1}^n \alpha_j b_j(x) +\end{align*} + +\setcounter{all}{2} +\inlineremark Unterräume $\mathcal{V}_n$ existieren nicht nur für Polynome, wir beschränken uns aber auf $b_j(x) = x^{i-1}$. +Andere Möglichkeiten: $b_j = \cos((j-1)\cos^-1(x))$ \textit{(Chebyshev)} oder $b_j = e^{i2\pi j x}$ \textit{(Trigonometrisch)} + +% FIXME: This could go into a special "maths theory" section -> GOOD + +\setcounter{all}{5} +\fancytheorem{Peano} $f$ stetig $\implies \exists p(x)$ welches $f$ in $||\cdot||_\infty$ beliebig gut approximiert. + +\setcounter{all}{7} +% FIXME: \inlinedef \textit{(Monom)} = \fancydef{Monom} (exactly the definition of fancy* macros) +\fancydef{Raum der Polynome} $\mathcal{P}_k := \{ x \mapsto \sum_{j = 0}^{k} \alpha_j x^j \}$ +\inlinedef \textit{(Monom)} $f: x \mapsto x^k$ + +\fancytheorem{Eigenschaft von $\mathcal{P}_k$} $\mathcal{P}_k$ ist ein Vektorraum mit $\dim(\mathcal{P}_k) = k+1$. diff --git a/semester3/numcs/parts/01_interpolation/00_polynomial/01_monome.tex b/semester3/numcs/parts/01_interpolation/00_polynomial/01_monome.tex new file mode 100644 index 0000000..7da3f84 --- /dev/null +++ b/semester3/numcs/parts/01_interpolation/00_polynomial/01_monome.tex @@ -0,0 +1,39 @@ +\subsection{Monombasis} + +\fancytheorem{Eindeutigkeit} $p(x) \in \mathcal(P)_k$ ist durch $k+1$ Punkte $y_i = p(x_i)$ eindeutig bestimmt. + +Dieser Satz kann direkt angewendet werden zur Interpolation, in dem man $p(x)$ als Gleichungssystem schreibt. +% FIXME: It'd probably be better to use align* environment in general, it's much more flexible +% FIXME: Having a new line before $$ (or align* environment for that matter) makes the space between text and math env larger! +$$ + p_n(x) = \alpha_n x^n + \cdots + \alpha_0 x^0 \quad \iff \quad + \underbrace{ + \begin{bmatrix} + 1 & x_0 & \cdots & x_0^n \\ + 1 & x_1 & \cdots & x_1^n \\ + \vdots & \vdots & \ddots & \vdots \\ + 1 & x_n & \cdots & x_n^n \\ + \end{bmatrix} + }_\text{Vandermonde Matrix} + \begin{bmatrix} + \alpha_0 \\ + \alpha_1 \\ + \vdots \\ + \alpha_n + \end{bmatrix} + = + \begin{bmatrix} + y_0 \\ + y_1 \\ + \vdots \\ + y_n + \end{bmatrix} +$$ + +Um $\alpha_i$ zu finden ist die Vandermonde Matrix unbrauchbar, da die Matrix schlecht konditioniert ist. + +Zur Auswertung von $p(x)$ kann man direkt die Matrix-darstellung nutzen, oder effizienter: + +\fancydef{Horner Schema} $p(x) = (x \ldots x ( x (\alpha_n x + \alpha_{n-1}) + \ldots + \alpha_1) + \alpha_0)$ + +\fhlc{Cyan}{In NumPy} \verb|polyfit| liefert die direkte Auswertung, \verb|polyval| wertet Polynome via Horner-Schema aus. (Gemäss Script, in der Praxis sind diese Funktionen \verb|deprecated|) diff --git a/semester3/numcs/parts/01_interpolation/00_polynomial/02_newton-basis.tex b/semester3/numcs/parts/01_interpolation/00_polynomial/02_newton-basis.tex new file mode 100644 index 0000000..5da7a88 --- /dev/null +++ b/semester3/numcs/parts/01_interpolation/00_polynomial/02_newton-basis.tex @@ -0,0 +1,2 @@ +\subsection{Newton Basis} +Session: Herleitung unwichtig, konzentrieren auf Funktion/Eigenschaften von Newton/Lagrange. diff --git a/semester3/numcs/parts/01_interpolation/00_polynomial/03_barzycentric-formula.tex b/semester3/numcs/parts/01_interpolation/00_polynomial/03_barzycentric-formula.tex new file mode 100644 index 0000000..e983180 --- /dev/null +++ b/semester3/numcs/parts/01_interpolation/00_polynomial/03_barzycentric-formula.tex @@ -0,0 +1,2 @@ +\subsection{Baryzentrische Formel} +Session: Gemäss TA sehr gut beschrieben im alten Script diff --git a/semester3/numcs/parts/01_interpolation/00_polynomial/04_chebychev-interpolation.tex b/semester3/numcs/parts/01_interpolation/00_polynomial/04_chebychev-interpolation.tex new file mode 100644 index 0000000..680c25b --- /dev/null +++ b/semester3/numcs/parts/01_interpolation/00_polynomial/04_chebychev-interpolation.tex @@ -0,0 +1,8 @@ +\subsection{Chebychev Interpolation} + +Session: Chebyshev Pol. : Abzisse = Extrema, Knoten = Nullstellen + +Lecture: Orthogonalität ist eine wichtige Eigenschaft: Siehe Lecture notes (handgeschr.) für Veranschaulichung. \\ +$\rightarrow$ Orth. liefert die Koeff. ohne Rechenaufwand. + +Lecture: Clenshaw-Alg. relativ zentral (Taschenrechner nutzen diesen intern) diff --git a/semester3/numcs/parts/fourier.tex b/semester3/numcs/parts/01_interpolation/01_trigonometric/00_intro.tex similarity index 73% rename from semester3/numcs/parts/fourier.tex rename to semester3/numcs/parts/01_interpolation/01_trigonometric/00_intro.tex index b61cdd5..b0e4157 100644 --- a/semester3/numcs/parts/fourier.tex +++ b/semester3/numcs/parts/01_interpolation/01_trigonometric/00_intro.tex @@ -1,6 +1,3 @@ -\newsection -\section{Trigonometrische Interpolation} - Lecture: Wir besitzen nicht das komplette Vorwissen in der Analysis für dieses Kapitel, d.h. wird totales Verständnis nicht -Lecture: Intuitiv wird Fourier-Trans. zur Kompression genutzt, z.b. jpg format. \ No newline at end of file +Lecture: Intuitiv wird Fourier-Trans. zur Kompression genutzt, z.b. jpg format. diff --git a/semester3/numcs/parts/interpolation.tex b/semester3/numcs/parts/interpolation.tex deleted file mode 100644 index 3351232..0000000 --- a/semester3/numcs/parts/interpolation.tex +++ /dev/null @@ -1,91 +0,0 @@ -\newsection -\section{Polynomiale Interpolation} -Bei der Interpolation versuchen wir eine Funktion $\tilde{f}$ durch eine Menge an Datenpunkten einer Funktion $f$ zu finden.\\ -Die $x_i$ heissen Stützstellen/Knoten, für welche $\tilde{f}(x_i) = y_i$ gelten soll. (Interpolationsbedingung) - -$$ -\begin{bmatrix} - x_0 & x_1 & \ldots & x_n \\ - y_0 & y_1 & \ldots & y_n -\end{bmatrix}, -\quad x_i, y_i \in \mathbb{R} -$$ - -Normalerweise stellt $f$ eine echte Messung dar, d.h. macht es Sinn anzunehmen dass $f$ glatt ist. - -Die informelle Problemstellung oben lässt sich durch Vektorräume formalisieren: - -$f \in \mathcal{V}$, wobei $\mathcal{V}$ ein Vektorraum mit $\dim(\mathcal{V}) = \infty$ ist. \\ -Wir suchen d.h. $\tilde{f}$ in einem Unterraum $\mathcal{V}_n$ mit endlicher $\dim(\mathcal{V}_n) = n$. -Sei $B_n = \{b_1,\ldots,b_n\}$ eine Basis für $\mathcal{V}_n$. -Dann lässt sich der Bezug zwischen $f$ und $\tilde{f} = f_n(x)$ so ausdrücken: - -$$f(x) \approx f_n(x) = \sum_{j=1}^n \alpha_j b_j(x)$$ - -\setcounter{all}{2} -\inlineremark Unterräume $\mathcal{V}_n$ existieren nicht nur für Polynome, wir beschränken uns aber auf $b_j(x) = x^{i-1}$. -Andere Möglichkeiten: $b_j = \cos((j-1)\cos^-1(x))$ \textit{(Chebyshev)} oder $b_j = e^{i2\pi j x}$ \textit{(Trigonometrisch)} - -% This could go into a special "maths theory" section - -\setcounter{all}{5} -\fancytheorem{Peano} $f$ stetig $\implies \exists p(x)$ welches $f$ in $||\cdot||_\infty$ beliebig gut approximiert. - -\setcounter{all}{7} -\fancydef{Raum der Polynome} $\mathcal{P}_k := \{ x \mapsto \sum_{j = 0}^{k} \alpha_j x^j \}$ \inlinedef \textit{(Monom)} $f: x \mapsto x^k$ - -\fancytheorem{Eigensch. von $\mathcal{P}_k$} $\mathcal{P}_k$ ist ein Vektorraum mit $\dim(\mathcal{P}_k) = k+1$. - -\subsection{Monombasis} - -\fancytheorem{Eindeutigkeit} $p(x) \in \mathcal(P)_k$ ist durch $k+1$ Punkte $y_i = p(x_i)$ eindeutig bestimmt. - -Dieser Satz kann direkt angewendet werden zur Interpolation, in dem man $p(x)$ als Gleichungssystem schreibt. - -$$ -p_n(x) = \alpha_n x^n + \cdots + \alpha_0 x^0 \quad \iff \quad -\underbrace{ - \begin{bmatrix} - 1 & x_0 & \cdots & x_0^n \\ - 1 & x_1 & \cdots & x_1^n \\ - \vdots & \vdots & \ddots & \vdots \\ - 1 & x_n & \cdots & x_n^n \\ - \end{bmatrix} -}_\text{Vandermonde Matrix} -\begin{bmatrix} - \alpha_0 \\ - \alpha_1 \\ - \vdots \\ - \alpha_n -\end{bmatrix} -= -\begin{bmatrix} - y_0 \\ - y_1 \\ - \vdots \\ - y_n -\end{bmatrix} -$$ - -Um $\alpha_i$ zu finden ist die Vandermonde Matrix unbrauchbar, da die Matrix schlecht konditioniert ist. - -Zur Auswertung von $p(x)$ kann man direkt die Matrix-darstellung nutzen, oder effizienter: - -\fancydef{Horner Schema} $p(x) = (x \ldots x ( x (\alpha_n x + \alpha_{n-1}) + \ldots + \alpha_1) + \alpha_0)$ - -\fhlc{Cyan}{In NumPy} \verb|polyfit| liefert die direkte Auswertung, \verb|polyval| wertet Polynome via Horner-Schema aus. (Gemäss Script, in der Praxis sind diese Funktionen \verb|deprecated|) - -\subsection{Newton Basis} -Session: Herleitung unwichtig, konzentrieren auf Funktion/Eigenschaften von Newton/Lagrange. - -\subsection{Baryzentrische Formel} -Session: Gemäss TA sehr gut beschrieben im alten Script - -\subsection{Chebychev Interpolation} - -Session: Chebyshev Pol. : Abzisse = Extrema, Knoten = Nullstellen - -Lecture: Orthogonalität ist eine wichtige Eigenschaft: Siehe Lecture notes (handgeschr.) für Veranschaulichung. \\ -$\rightarrow$ Orth. liefert die Koeff. ohne Rechenaufwand. - -Lecture: Clenshaw-Alg. relativ zentral (Taschenrechner nutzen diesen intern) \ No newline at end of file