2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

Remove 'Numerik' as it is out of scope for this project

Move it to https://github.com/MartinThoma/KIT-Musterloesungen
This commit is contained in:
Martin Thoma 2016-03-17 23:21:07 +01:00
parent c2e2ba7769
commit 30b0bd8c18
55 changed files with 1 additions and 2157 deletions

View file

@ -1,130 +0,0 @@
\section*{Aufgabe 1}
\subsection*{Teilaufgabe a}
\textbf{Gegeben:}
\[A =
\begin{pmatrix}
3 & 15 & 13 \\
6 & 6 & 6 \\
2 & 8 & 19
\end{pmatrix}\]
\textbf{Aufgabe:} LR-Zerlegung von $A$ mit Spaltenpivotwahl
\textbf{Lösung:}
\begin{align*}
&
&
A^{(0)} &= \begin{gmatrix}[p]
3 & 15 & 13 \\
6 & 6 & 6 \\
2 & 8 & 19
\rowops
\swap{0}{1}
\end{gmatrix}
&\\
P^{(1)} &= \begin{pmatrix}
0 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix},
&
A^{(1)} &= \begin{gmatrix}[p]
6 & 6 & 6 \\
3 & 15 & 13 \\
2 & 8 & 19
\rowops
\add[\cdot (-\frac{1}{2})]{0}{1}
\add[\cdot (-\frac{1}{3})]{0}{2}
\end{gmatrix}
&\\
L^{(1)} &= \begin{pmatrix}
1 & 0 & 0\\
-\frac{1}{2} & 1 & 0\\
-\frac{1}{3} & 0 & 1
\end{pmatrix},
&
A^{(2)} &= \begin{gmatrix}[p]
6 & 6 & 6 \\
0 & 12 & 10 \\
0 & 6 & 17
\rowops
\add[\cdot (-\frac{1}{2})]{1}{2}
\end{gmatrix}
&\\
L^{(2)} &= \begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & -\frac{1}{2} & 1
\end{pmatrix},
&
A^{(3)} &= \begin{gmatrix}[p]
6 & 6 & 6 \\
0 & 12 & 10 \\
0 & 0 & 12
\end{gmatrix}
\end{align*}
Es gilt:
\begin{align}
L^{(2)} \cdot L^{(1)} \cdot \underbrace{P^{(1)}}_{=: P} \cdot A^{0} &= \underbrace{A^{(3)}}_{=: R}\\
\Leftrightarrow P A &= (L^{(2)} \cdot L^{(1)})^{-1} \cdot R \\
\Rightarrow L &= (L^{(2)} \cdot L^{(1)})^{-1}\\
&= \begin{pmatrix}
1 & 0 & 0\\
\frac{1}{2} & 1 & 0\\
\frac{1}{3} & \frac{1}{2} & 1
\end{pmatrix}
\end{align}
Nun gilt: $P A = L R = A^{(1)}$ (Kontrolle mit \href{http://www.wolframalpha.com/input/?i=%7B%7B1%2C0%2C0%7D%2C%7B0.5%2C1%2C0%7D%2C%7B1%2F3%2C0.5%2C1%7D%7D*%7B%7B6%2C6%2C6%7D%2C%7B0%2C12%2C10%7D%2C%7B0%2C0%2C12%7D%7D}{Wolfram|Alpha})
\subsection*{Teilaufgabe b}
\textbf{Gegeben:}
\[A =
\begin{pmatrix}
9 & 4 & 12 \\
4 & 1 & 4 \\
12 & 4 & 17
\end{pmatrix}\]
\textbf{Aufgabe:} $A$ auf positive Definitheit untersuchen, ohne Eigenwerte zu berechnen.
\textbf{Vorüberlegung:}
Eine Matrix $A \in \mathbb{R}^{n \times n}$ heißt positiv definit $\dots$
\begin{align*}
\dots & \Leftrightarrow \forall x \in \mathbb{R}^n \setminus \Set{0}: x^T A x > 0\\
& \Leftrightarrow \text{Alle Eigenwerte sind größer als 0}
\end{align*}
Falls $A$ symmetrisch ist, gilt:
\begin{align*}
\text{$A$ ist positiv definit} & \Leftrightarrow \text{alle führenden Hauptminore von $A$ sind positiv}\\
& \Leftrightarrow \text{es gibt eine Cholesky-Zerlegung $A=GG^T$}\\
\end{align*}
\subsubsection*{Lösung 1: Hauptminor-Kriterium}
\begin{align}
\det(A_1) &= 9 > 0\\
\det(A_2) &=
\begin{vmatrix}
9 & 4 \\
4 & 1 \\
\end{vmatrix} = 9 - 16 < 0\\
&\Rightarrow \text{$A$ ist nicht positiv definit}
\end{align}
\subsubsection*{Lösung 2: Cholesky-Zerlegung}
\begin{align}
l_{11} &= \sqrt{a_{11}} = 3\\
l_{21} &= \frac{a_{21}}{l_{11}} = \frac{4}{3}\\
l_{31} &= \frac{a_{31}}{l_{11}} = \frac{12}{3} = 4\\
l_{22} &= \sqrt{a_{22} - {l_{21}}^2} = \sqrt{1 - \frac{16}{9}}= \sqrt{-\frac{7}{9}} \notin \mathbb{R}\\
& \Rightarrow \text{Es ex. keine Cholesky-Zerlegung, aber $A$ ist symmetrisch}\\
& \Rightarrow \text{$A$ ist nicht positiv definit}
\end{align}

View file

@ -1,53 +0,0 @@
\section*{Aufgabe 2}
\subsection*{Teilaufgabe a}
\textbf{Aufgabe}
Formulieren Sie einen Algorithmus in Pseudocode zum Lösen des Gleichungssystems
\[Ly = b,\]
wobei $L$ eine invertierbare, untere Dreiecksmatrix ist.
Geben Sie die Formel zur Berechnung von $y_i$ an.
\textbf{Lösung:}
\[y_i = \frac{b_i - \sum_{k=1}^{i-1} l_{ik} \cdot y_k}{l_{ii}}\]
\begin{algorithm}[H]
\begin{algorithmic}
\Require Lower, invertable, triangular Matrix $L \in \mathbb{R}^{n \times n}$, Vektor $b$
\Procedure{solve}{$L$, $b$}
\For{$i \in \Set{1, \dots n}$}
\State $y_i \gets b_i$
\For{$k \in \Set{1, \dots, i-1}$}
\State $y_i \gets y_i - l_{ik} \cdot y_k$
\EndFor
\State $y_i \gets \frac{y_i}{l_{ii}}$
\EndFor
\EndProcedure
\end{algorithmic}
\caption{Calculate $y$ in $Ly = b$}
\end{algorithm}
\subsection*{Teilaufgabe b}
\[Ax = b \Leftrightarrow PAx = Pb \Leftrightarrow LRx = Pb \]
\begin{algorithm}[H]
\begin{algorithmic}
\Require Matrix $A$, Vektor $b$
\Procedure{LoeseLGS}{$A$, $b$}
\State $P, L, R \gets \Call{LRZer}{A}$
\State $b^* \gets P \cdot b$
\State $c \gets \Call{VorSub}{L, b^*}$
\State $x \gets \Call{RueckSub}{R, c}$
\State \Return $x$
\EndProcedure
\end{algorithmic}
\caption{Löse ein LGS $Ax = b$}
\end{algorithm}
\subsection*{Teilaufgabe c}
Der Gesamtaufwand ist:
\begin{itemize}
\item LR-Zerlegung, $\frac{1}{3}n^3 - \frac{1}{3} n^2$
\item Vektormultiplikation, $2n$
\item Vorwärtssubstitution, $\frac{1}{2} n^2$
\item Rückwärtssubstitution, $\frac{1}{2} n^2$
\end{itemize}

View file

@ -1,165 +0,0 @@
\section*{Aufgabe 3}
Die Jacobi-Matrix von $f$ lautet:
\[f' (x,y) = \begin{pmatrix}
3 & \cos y\\
3 x^2 & e^y
\end{pmatrix}\]
Hierfür wurde in in der ersten Spalte nach $x$ abgeleitet und in der
zweiten Spalte nach $y$.
Eine Iteration des Newton-Verfahren ist durch
\begin{align}
x_{k+1}&=x_{k}\underbrace{-f'(x_k)^{-1}\cdot f(x_k)}_{\Delta x}
\end{align}
gegeben (vgl. Skript, S. 35).
Zur praktischen Durchführung lösen wir
\begin{align}
f'(x_0, y_0)\Delta x &= -f(x_0,y_0)\\
L \cdot \underbrace{R \cdot \Delta x}_{=: c} &= -f(x_0, y_0)
\end{align}
mit Hilfe der LR Zerlegung nach $\Delta x$ auf.
\subsection*{Lösungsvorschlag 1 (Numerische Lösung)}
\begin{align}
%
f'(x_0,y_0) &= L \cdot R \\
\Leftrightarrow f'(-\nicefrac{1}{3}, 0) &= L \cdot R \\
\Leftrightarrow \begin{pmatrix}
3 & 1\\
\frac{1}{3} & 1
\end{pmatrix}
&=
\overbrace{\begin{pmatrix}
1 & 0\\
\frac{1}{9} & 1
\end{pmatrix}}^{=: L} \cdot
\overbrace{\begin{pmatrix}
3 & 1\\
0 & \frac{8}{9}
\end{pmatrix}}^{=: R}\\
%
L \cdot c &= -f(x_0,y_0) \\
\Leftrightarrow
\begin{pmatrix}
1 & 0\\
\frac{1}{9} & 1
\end{pmatrix}
\cdot c
&= -
\begin{pmatrix}
2\\
\frac{26}{27}
\end{pmatrix}\\
\Rightarrow
c &= \begin{pmatrix}
-2\\
-\frac{20}{27}
\end{pmatrix}\footnotemark\\
%
R\cdot \Delta x &= c\\
\Leftrightarrow
\begin{pmatrix}
3 & 1\\
0 & \frac{8}{9}
\end{pmatrix}
\cdot \Delta x &=
\begin{pmatrix}
-2\\
-\frac{20}{27}
\end{pmatrix}\\
\Rightarrow \Delta x &= \frac{1}{18}
\begin{pmatrix}
-7\\
-15
\end{pmatrix}
\end{align}
\footnotetext{Dieser Schritt wird durch Vorwärtssubsitution berechnet.}
Anschließend berechnen wir
\begin{align}
\begin{pmatrix}
x_1\\
y_1
\end{pmatrix} &=
\begin{pmatrix}
x_0\\
y_0
\end{pmatrix}+\Delta x \\
\Leftrightarrow\begin{pmatrix}
x_1\\
y_1
\end{pmatrix} &=
\begin{pmatrix}
-\frac{1}{3}\\
0
\end{pmatrix} +
\frac{1}{18}
\begin{pmatrix}
-7\\
-15
\end{pmatrix} \\
\Leftrightarrow\begin{pmatrix}
x_1\\
y_1
\end{pmatrix} &=
\begin{pmatrix}
-\nicefrac{13}{18}\\
-\nicefrac{15}{18}
\end{pmatrix}
\end{align}
\subsection*{Lösungsvorschlag 2 (Analytische Lösung)}
LR-Zerlegung für $f'(x, y)$ kann durch scharfes hinsehen durchgeführt
werden, da es in $L$ nur eine Unbekannte links unten gibt. Es gilt
also ausführlich:
\begin{align}
\begin{pmatrix}
3 & \cos y\\
3 x^2 & e^y
\end{pmatrix}
&=
\overbrace{\begin{pmatrix}
1 & 0\\
l_{12} & 1
\end{pmatrix}}^L \cdot
\overbrace{\begin{pmatrix}
r_{11} & r_{12}\\
0 & r_{22}
\end{pmatrix}}^R\\
\Rightarrow r_{11} &= 3\\
\Rightarrow r_{12} &= \cos y\\
\Rightarrow \begin{pmatrix}
3 & \cos y\\
3 x^2 & e^y
\end{pmatrix}
&=
\begin{pmatrix}
1 & 0\\
l_{12} & 1
\end{pmatrix} \cdot
\begin{pmatrix}
3 & \cos y\\
0 & r_{22}
\end{pmatrix}\\
\Rightarrow 3x^2 &\stackrel{!}{=} l_{12} \cdot 3 + 1 \cdot 0\\
\Leftrightarrow l_{12} &= x^2\\
\Rightarrow e^y &\stackrel{!}{=} x^2 \cdot \cos y + 1 \cdot r_{22}\\
\Leftrightarrow r_{22} &= -x^2 \cdot \cos y + e^y\\
\Rightarrow \begin{pmatrix}
3 & \cos y\\
3 x^2 & e^y
\end{pmatrix}
&=
\begin{pmatrix}
1 & 0\\
x^2 & 1
\end{pmatrix} \cdot
\begin{pmatrix}
3 & \cos y\\
0 & -x^2 \cdot \cos y + e^y
\end{pmatrix}\\
P &= I_2
\end{align}

View file

@ -1,73 +0,0 @@
\section*{Aufgabe 4}
\textbf{Aufgabe}:
\[I(f) = \int_a^b f(x) \mathrm{d}x \]
\begin{enumerate}
\item Integrand am linken und am rechten Rand interpolieren
\item Interpolationspolynom mit Quadraturformel integrieren
\end{enumerate}
\textbf{Lösung}:
Nutze Interpolationsformel von Lagrange:
\begin{align}
L_i &= \frac{\prod_{j=1, j \neq i}^n (x-x_j)}{\prod_{j=1, j \neq i}^n (x_i - x_j)}\\
p(x) &= \sum_{i=0}^{1} f_i \cdot L_i(x)
\end{align}
Berechne Lagrangepolynome:
\begin{align}
L_0(x) = \frac{x-b}{a-b} \\
L_1(x) = \frac{x-a}{b-a}
\end{align}
So erhalten wir:
\begin{align}
p(x) &= f(a) \frac{x-b}{a-b} + f(b) \frac{x-a}{b-a}\\
&= \frac{f(a) (b-x) + f(b) (x-a)}{b-a} \\
&= \frac{f(a)b- f(a)x + f(b) x- f(b)a}{b-a}\\
&=\frac{x \cdot \left (f(b)-f(a) \right ) + f(a)b- f(b)a}{b-a}\\
&= x \cdot \underbrace{\frac{f(b)-f(a)}{b-a}}_{=:r} + \underbrace{\frac{f(a)b - f(b)a}{b-a}}_{=: s}
\end{align}
Nun integrieren wir das Interpolationspolynom:
\begin{align}
\int_a^b p(x) \mathrm{d} x &= \left [\frac{r}{2} x^2 + sx \right ]_a^b\\
&= \left (\frac{a^2 r}{2} + sa \right ) - \left (\frac{b^2 r}{2} + sb \right )\\
&= a\left (\frac{a r}{2} + s \right ) - b \left (\frac{b r}{2} + s \right )\\
&= a\left (\frac{a \frac{f(b)-f(a)}{b-a}}{2} + \frac{f(a)b - f(b)a}{b-a} \right ) - b \left (\frac{b \frac{f(b)-f(a)}{b-a}}{2} + \frac{f(a)b - f(b)a}{b-a} \right )\\
&= a\left (\frac{-a f(a)+2b f(a)-a f(b)}{2 \cdot(b-a)}\right ) - b \left (\frac{bf(b) + b f(a) - 2 a f(b)}{2 \cdot (b-a)} \right )\\
& \dots \text{theoretisch sollte das zu } (b-a)(\frac{f(a)}{2} + \frac{f(b)}{2}) \text{ zu vereinfachen sein}
\end{align}
Alternativer Rechenweg
\[ \int_a^b p(x)dx = \int_a^b f(a) \frac{x-b}{a-b}dx + \int_a^b f(b) \frac{x-a}{b-a}dx \]
\[ = \int_a^b \frac{f(a) \cdot x}{a-b}dx - \int_a^b \frac{f(a) \cdot b}{a-b}dx + \int_a^b \frac{f(b) \cdot x}{b-a}dx - \int_a^b \frac{f(b) \cdot a}{b-a}dx \]
\[ = \frac{1}{2} \cdot \frac{f(a) \cdot b^2}{a-b} - \frac{1}{2} \cdot \frac{f(a) \cdot a^2}{a-b} - \frac{f(a) \cdot b^2}{a-b} + \frac{f(a) \cdot b \cdot a}{a-b} + \frac{1}{2} \cdot \frac{f(b) \cdot b^2}{b-a} \]
\[ - \frac{1}{2} \cdot \frac{f(b) \cdot a^2}{b-a} - \frac{f(b) \cdot a \cdot b}{b-a} + \frac{f(b) \cdot a^2}{b-a}\]
\[=(b-a)\cdot(\frac{f(a)}{2} + \frac{f(b)}{2})\]
Betrachtet man nun die allgemeine Quadraturformel,
\[
\int_a^b f(x)dx \approx (b-a) \sum_{i=1}^s b_i f(a+c_i(b-a))
\]
so gilt für die hergeleitete Quadraturformel also $s=2$, $c_1=0, c_2=1$ und $b_1 = b_2 = \frac{1}{2}$. Sie entspricht damit der Trapezregel.
\subsection*{Teilaufgabe b)}
Sei nun $f(x) = x^2$ und $a = 0$ sowie $b = 4$. Man soll die ermittelte
Formel zwei mal auf äquidistanten Intervallen anwenden.
\textbf{Lösung:}
\begin{align}
\int_0^4 p(x) \mathrm{d}x &= \int_0^2 p(x)\mathrm{d}x + \int_2^4 p(x)\mathrm{d}x \\
&= (2-0)\cdot \left (\frac{0}{2} + \frac{4}{2} \right ) + (4-2) \cdot \left (\frac{4}{2} + \frac{16}{2} \right )\\
&= 2 \cdot 2 + 2 \cdot (2+8)\\
&= 24
\end{align}

View file

@ -1,67 +0,0 @@
\section*{Aufgabe 5}
\subsection*{Teilaufgabe a}
Eine Quadraturformel $(b_i, c_i)_{i=1, \dots, s}$ hat die Ordnung
$p$, falls sie exakte Lösungen für alle Polynome vom Grad $\leq p -1$
liefert.
\subsection*{Teilaufgabe b}
Die Ordnungsbedingungen, mit denen man zeigen kann, dass eine Quadraturformel
mindestens Ordnung $p$ hat, lautet:
\[\forall p \in \Set{1, \dots, p}: \sum_{i=1}^s b_i c_i^{q-1} = \frac{1}{q}\]
\subsection*{Teilaufgabe c}
\paragraph{Aufgabe} Bestimmen Sie zu den Knoten $c_1 = 0$ und $c_2 = \frac{2}{3}$ Gewichte, um eine Quadraturformel
maximaler Ordnung zu erhalten. Wie hoch ist die Ordnung?
\paragraph{Lösung}
Nach VL kann bei Vorgabe von $s$ Knoten auch die Ordnung $s$ durch
geschickte Wahl der Gewichte erreicht werden. Nach Satz 27 ist diese
Wahl eindeutig.
Also berechnen wir die Gewichte, um die Ordnung $p=2$ zu sichern.
Dazu stellen wir zuerst die Lagrange-Polynome auf:
\begin{align}
L_1(x) &= \frac{x-x_2}{x_1 - x_2} = \frac{x-c_2}{c_1-c_2} = \frac{x-\nicefrac{2}{3}}{-\nicefrac{2}{3}} = -\frac{3}{2} x + 1\\
L_2(x) &= \frac{x-x_1}{x_2 - x_1} = \frac{x-c_1}{c_2-c_1} = \frac{x}{\nicefrac{2}{3}} = \frac{3}{2} x
\end{align}
Nun gilt für die Gewichte:
\begin{align}
b_i &= \int_0^1 L_i(x) \mathrm{d}x\\
b_1 &= \int_0^1 -\frac{3}{2} x + 1 \mathrm{d}x = \left [ -\frac{3}{4}x^2 + x \right ]_0^1 = \frac{1}{4}\\
b_2 &= \frac{3}{4}
\end{align}
Nun sind die Ordnungsbedingungen zu überprüfen:
\begin{align}
\nicefrac{1}{1} &\stackrel{?}{=} b_1 c_1^0 + b_2 c_2^0 = \nicefrac{1}{4} + \nicefrac{3}{4} \text{\;\;\cmark}\\
\nicefrac{1}{2} &\stackrel{?}{=} b_1 c_1^1 + b_2 c_2^1 = \frac{1}{4} \cdot 0 + \frac{3}{4} \cdot \frac{2}{3} \text{\;\;\cmark}\\
\nicefrac{1}{3} &\stackrel{?}{=} b_1 c_1^2 + b_2 c_2^2 = \frac{1}{4} \cdot 0 + \frac{3}{4} \cdot \frac{4}{9} \text{\;\;\cmark}\\
\nicefrac{1}{4} &\stackrel{?}{=} b_1 c_1^3 + b_2 c_2^3 = \frac{1}{4} \cdot 0 + \frac{3}{4} \cdot \frac{8}{27} \text{\;\;\xmark}\\
\end{align}
Die Quadraturformel mit den Knoten $c_1 = 0$, $c_2 = \nicefrac{2}{3}$ sowie
den Gewichten $b_1 = \nicefrac{1}{4}$, $b_2 = \nicefrac{3}{4}$ erfüllt
also die 1., 2. und 3. Ordnungsbedingung, nicht jedoch die 4.
Ordnungsbedingung. Ihre maximale Ordnung ist also $p=3$.
\textbf{Anmerkungen:} Da $c_1 = 0$ kann es sich nicht um die Gauß-QF handeln.
Somit können wir nicht Ordnung $p=4$ erreichen.
Bei der Suche nach den Gewichten hätte man alternativ auch das folgende
LGS lösen können:
\begin{align}
\begin{pmatrix}
c_1^0 & c_2^0\\
c_1^1 & c_2^1
\end{pmatrix}
\cdot x
=
\begin{pmatrix}
1\\
\nicefrac{1}{2}
\end{pmatrix}
\end{align}

View file

@ -1,49 +0,0 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{pdfpages} % Signatureinbingung und includepdf
\usepackage{geometry} % [margin=2.5cm]layout
\usepackage[pdftex]{hyperref} % links im text
\usepackage{color}
\usepackage{framed}
\usepackage{enumerate} % for advanced numbering of lists
\usepackage{marvosym} % checkedbox
\usepackage{wasysym}
\usepackage{braket} % for \Set{}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{gauss}
\usepackage{algorithm,algpseudocode}
\usepackage{units}
\usepackage{parskip}
\usepackage{lastpage}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\title{Numerik Klausur 1 - Musterlösung}
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Martin Thoma, Peter, Felix},
pdfkeywords = {Numerik, KIT, Klausur},
pdftitle = {\@title}
}
\pagestyle{fancy}
\lhead{\@title}
\rhead{Seite \thepage{} von \pageref{LastPage}}
}
\makeatother
\usepackage{fancyhdr}
\fancyfoot[C]{}
\begin{document}
\include{Aufgabe1}
\include{Aufgabe2}
\include{Aufgabe3}
\include{Aufgabe4}
\include{Aufgabe5}
\end{document}

View file

@ -1,8 +0,0 @@
SOURCE = Klausur1
make:
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.pyg

View file

@ -1,4 +0,0 @@
Dies ist eine inoffizielle Lösung für [Klausur1.pdf von Dr. Daniel Weiß](http://www.math.kit.edu/ianm3/lehre/numainfing2013s/seite/uebnuminfing).
Verbesserungsvorschläge gerne per [GitHub Pull Request](https://help.github.com/articles/using-pull-requests)
an mich schicken oder auch einfach per E-Mail an info@martin-thoma.de

View file

@ -1,87 +0,0 @@
\section*{Aufgabe 1}
\subsection*{Teilaufgabe a)}
\paragraph{Gegeben:}
\[A := \begin{pmatrix}
4 & 2 & 8\\
2 & 5 & 8\\
8 & 8 & 29
\end{pmatrix}\]
\paragraph{Aufgabe:} Cholesky-Zerlegung $A = \overline{L} \cdot \overline{L}^T$ berechnen
\paragraph{Rechenweg:}
Entweder mit dem Algorithmus:
\begin{algorithm}[H]
\begin{algorithmic}
\Function{Cholesky}{$A \in \mathbb{R}^{n \times n}$}
\State $L = \Set{0} \in \mathbb{R}^{n \times n}$ \Comment{Initialisiere $L$}
\For{($k=1$; $\;k \leq n$; $\;k$++)}
\State $L_{k,k} = \sqrt{A_{k,k} - \sum_{i=1}^{k-1} L_{k,i}^2}$
\For{($i=k+1$; $\;i \leq n$; $\;i$++)}
\State $L_{i,k} = \frac{A_{i,k} - \sum_{j=1}^{k-1} L_{i,j} \cdot L_{k,j}}{L_{k,k}}$
\EndFor
\EndFor
\State \Return $L$
\EndFunction
\end{algorithmic}
\caption{Cholesky-Zerlegung}
\label{alg:seq1}
\end{algorithm}
oder über die LR-Zerlegung:
\begin{align}
A &= L\cdot R\\
&= L\cdot(D\cdot L^T)\\
&= L\cdot(D^\frac{1}{2} \cdot D^\frac{1}{2})\cdot L^T\\
&= \underbrace{(L\cdot D^\frac{1}{2})}_{=: \overline{L}} \cdot (D^\frac{1}{2} \cdot L^T)
\end{align}
\paragraph{Lösung:}
$
\overline{L} =
\begin{pmatrix}
2 & 0 & 0 \\
1 & 2 & 0 \\
4 & 2 & 3 \\
\end{pmatrix}
$
\subsection*{Teilaufgabe b)}
\textbf{Gesucht}: $\det(A)$
Sei $P \cdot A = L \cdot R$, die gewohnte LR-Zerlegung.
Dann gilt:
\[\det(A) = \frac{\det(L) \cdot \det(R)}{\det(P)}\]
$\det(L) = 1$, da alle Diagonalelemente 1 sind und es sich um eine strikte untere Dreiecksmatrix handelt.
$\det(R) = r_{11} \cdot \ldots \cdot r_{nn}$, da es sich um eine obere Dreiecksmatrix handelt.
$\det(P) \in \Set{1, -1}$
Das Verfahren ist also:
\begin{algorithm}[H]
\begin{algorithmic}
\Require $A \in \mathbb{R}^{n \times n}$
\State $P, L, R \gets \Call{LRZerl}{A}$
\State $x \gets 1$
\For{$i$ in $1..n$}
\State $x \gets x \cdot r_{ii}$
\State $x \gets x \cdot p_{ii}$
\EndFor
\end{algorithmic}
\caption{Determinante berechnen}
\label{alg:seq1}
\end{algorithm}
Alternativ kann man auch in einer angepassten LR-Zerlegung direkt die
Anzahl an Zeilenvertauschungen zählen. Dann benötigt man $P$ nicht mehr.
Ist die Anzahl der Zeilenvertauschungen ungerade, muss das Produkt
der $r_ii$ negiert werden.

View file

@ -1,66 +0,0 @@
\section*{Aufgabe 2}
\paragraph{Voraussetzung:}
Gegeben sei eine Funktion $F$:
\begin{align*}
F: \mathbb{R} &\rightarrow [-1, 1]\\
F(x) &:= \cos(x)
\end{align*}
sowie eine Folge $(x)_k$ mit $x_{k+1} := F(x_k)$.
\paragraph{Behauptung:} $\displaystyle \exists! x^*: \forall x \in \mathbb{R}: \lim_{k \rightarrow \infty} x_k = x^*$
\paragraph{Beweis:} über den Banachschen Fixpunktsatz.
\begin{proof}
Sei $ x \in \mathbb{R}$, so gilt:\marginpar{Teil 1: Fix\-punkte können nur in $[0,1]$ sein.}
\begin{align*}
-1 \leq \cos(x) \leq 1
\end{align*}
Also genügt es $x \in [-1, 1]$ auf der Suche nach Fixpunkten zu betrachten.
Sei nun $x \in [-1, 0)$. Dann gilt: $\cos(x) > 0$. Da $x <0$ aber $F(x) > 0$,
kann kein Fixpunkt in $[-1, 0)$ sein. Es genügt also sogar,
nur $[0, 1]$ zu betrachten.
Sei $0 \leq x < y \leq 1$. Dann folgt:\marginnote{Teil 2: $F$ ist auf $[0,1]$ eine Kontraktion}
\begin{align}
\stackrel{\text{Mittelwertsatz}}{\Rightarrow} \exists L \in (x,y): \frac{\cos(y) - \cos(x)}{y-x} &= f'(L)\\
\Rightarrow \exists L \in [0,1]: \| \cos y - \cos x \| &= \| - \sin(L) \cdot (y-x)\| \\
&= \underbrace{\sin(L)}_{[0,1)} (y-x)\\
\Rightarrow F \text{ ist Kontraktion auf [0,1]}
\end{align}
Da $F|_{[0,1]}$ eine Selbstabbildung und eine Kontraktion ist und
offensichtlich $[0,1]$ abgeschlossen ist, greift der
Banachsche Fixpunktsatz. Es folgt direkt, dass auch für alle $x \in [0,1]$
die Folge $(x)_k$ gegen den einzigen Fixpunkt $x^*$ konvergiert.
\end{proof}
\subsection*{Anmerkung}
Um zu zeigen, dass es genau einen Fixpunkt $x^*$ in $(0,1)$ gibt,
braucht man den Banachschen Fixpunktsatz nicht. Nur um zu zeigen,
dass die Fixpunktiteration auf für jedes $x \in \mathbb{R}$ gegen
diesen Fixpunkt $x^*$ konvergiert, braucht man ihn.
So kann man die existenz eines Fixpunktes zeigen:
Offensichtlich ist $F(0) \neq 0$ und $F(1) \neq 1$, also ist der
Fixpunkt - falls vorhanden - in $(0,1)$. $F$ ist in $(0,1)$ stetig
und streng monoton fallend. Da auch $-x$ in $(0,1)$ streng monoton
fallend ist, folgt, dass $\cos(x) - x$ in $(0,1)$ streng monoton
fallend ist.
$x=0 \Rightarrow \cos(x) - x = \cos(0) - 0 = 1$
$x=45^\circ = \frac{1}{4} \pi < 1 \Rightarrow \cos(45^\circ) - \frac{\pi}{4} = \frac{\sqrt{2}}{2} - \frac{\pi}{4} <0$, da
\begin{align}
8 &< 9 < \pi^2\\
\Rightarrow \sqrt{8} &< \pi\\
\Leftrightarrow 2 \sqrt{2} &< \pi\\
\Leftrightarrow \frac{\sqrt{2}}{2} &< \frac{\pi}{4}
\end{align}
$\stackrel{\text{Zwischenwertsatz}}{\Rightarrow} \exists x^*: \cos(x^*) - x^* = 0 \Leftrightarrow \exists x^*: \cos(x^*) = x^*$.
Dieses $x^*$ ist eindeutig, da $\cos(x)-x$ \emph{streng} monoton fallend ist.

View file

@ -1,56 +0,0 @@
\section*{Aufgabe 3}
\textbf{Gegeben:}
\begin{table}[h!]
\begin{tabular}{l||l|l|l|l}
$f_i$ & 7 & 1 & -1 & 7 \\\hline
$x_i$ & -1 & 0 & 1 & 2 \\
\end{tabular}
\end{table}
\subsection*{Teilaufgabe a)}
Allgemein lauten Lagrange-Polynome:
\[L_i = \frac{\overbrace{\prod_{j=0, j \neq i}^n (x-x_j)}^\text{Produkt der Nullstellen}}{\underbrace{\prod_{j=0, j \neq i}^n (x_i - x_j)}_\text{Normalisierungsfaktor}}\]
Im speziellen:
\begin{align}
L_0(x) &= \frac{(x-0)(x-1)(x-2)}{(-1-0)(-1-1)(-1-2)} &&=-\frac{1}{6} \cdot (x^3 - 3 x^2 + 2x)\\
L_1(x) &= \frac{(x+1)(x-1)(x-2)}{(0+1)(0-1)(0-2)} &&= \frac{1}{2} \cdot (x^3 - 2x^2 - x + 2)\\
L_2(x) &= \frac{(x+1)x(x-2)}{(1+1)(1-0)(1-2)} &&=-\frac{1}{2} \cdot (x^3 - x^2 - 2x)\\
L_3(x) &= \frac{(x+1)(x-0)(x-1)}{(2+1)(2-0)(2-1)} &&= \frac{1}{6} \cdot (x^3 - x)
\end{align}
Durch die Interpolationsformel von Lagrange
\[p(x) = \sum_{i=0}^n f_i L_i(x)\]
ergibt sich
\begin{align}
p(x) &= x^3 + 2x^2 - 5x + 1
\end{align}
Anmerkung: Es ist nicht notwendig die Monomdarstellung zu berechnen.
In diesem Fall hat es jedoch das Endergebnis stark vereinfacht.
\subsection*{Teilaufgabe b)}
Für die Berechnung der dividierten Differenzen gilt allgemein:
\begin{align}
f[x_i, \dots, x_{i+k}] = \frac{f[x_i, \dots x_{(i+k)-1}] - f[x_{i+1}, \dots x_{i+k}]}{x_i - x_{i+k}}
\end{align}
In diesem Fall bedeutet das konkret:
\begin{align}
f[x_0] &= 7, &f[x_1] &= 1, & f[x_2] &= -1, & f[x_3] = 7\\
f[x_0, x_1] &= -6, &f[x_1, x_2] &= -2, &f[x_2, x_3] &= 8\\
f[x_0, x_1, x_2] &= 2, &f[x_1, x_2, x_3] &= 5\\
f[x_0, x_1, x_2, x_3] &= 1
\end{align}
Insgesamt ergibt sich also
\begin{align}
p(x) &= 7 + (x-\underbrace{(-1)}_{x_0}) \cdot (-6) + (x-\underbrace{(-1)}_{x_0}) \cdot (x-\underbrace{(0)}_{x_1}) \cdot 2 + (x+1) \cdot x \cdot (x-1)\\
&= 7 -6 (x+1) + 2x(x+1) + x(x+1)(x-1)
\end{align}
(Siehe erste Spalte mit $x_0$)

View file

@ -1,47 +0,0 @@
\section*{Aufgabe 4}
\subsection*{Teilaufgabe a)}
\begin{enumerate}
\item Ordnung 3 kann durch geschickte Gewichtswahl erzwungen werden.
\item Ordnung 4 ist automatisch gegeben, da die QF symmetrisch sein soll.
\item Aufgrund der Symmetrie gilt Äquivalenz zwischen Ordnung 5 und 6.
Denn eine hätte die QF Ordnung 5, so wäre wegen der
Symmetrie Ordnung 6 direkt gegeben. Ordnung 6 wäre aber
bei der Quadraturformel mit 3 Knoten das Maximum, was nur
mit der Gauß-QF erreicht werden kann. Da aber $c_1 = 0$ gilt,
kann es sich hier nicht um die Gauß-QF handeln. Wegen
erwähnter Äquivalenz kann die QF auch nicht Ordnung 5 haben.
\end{enumerate}
Da $c_1 = 0$ gilt, muss $c_3 = 1$ sein (Symmetrie). Und dann muss $c_2 = \frac{1}{2}$
sein. Es müssen nun die Gewichte bestimmt werden um Ordnung 3 zu
garantieren mit:
\begin{align}
b_i &= \int_0^1 L_i(x) \mathrm{d}x\\
b_1 &= \frac{1}{6},\\
b_2 &= \frac{4}{6},\\
b_3 &= \frac{1}{6}
\end{align}
\subsection*{Teilaufgabe b)}
Als erstes ist festzustellen, dass es sich hier um die Simpsonregel handelt und die QF
\begin{align}
\int_a^b f(x) \mathrm{d}x &= (b-a) \cdot \frac{1}{6} \cdot \left ( f(a) + 4 \cdot f(\frac{a+b}{2}) + f(b) \right )
\end{align}
ist. Wenn diese nun auf $N$ Intervalle aufgepflittet wird gilt folgendes:
\begin{align}
h &= \frac{(b-a)}{N} \\
\int_a^b f(x) \mathrm{d}x &= h \cdot \frac{1}{6} \cdot \left [ f(a) + f(b) + 2 \cdot \sum_{i=1}^{N-1} f(a + i \cdot h) + 4 \cdot \sum_{l=0}^{N-1} f(a + \frac{1}{2} \cdot h + l \cdot h)\right ]
\end{align}
$\sum_{i=1}^{N-1} f(a + i \cdot h)$ steht für die Grenzknoten
(deshalb werden sie doppelt gezählt). Von den Grenzknoten gibt es
insgesamt $N-2$ Stück, da die tatsächlichen Integralgrenzen $a$ und $b$
nur einmal in die Berechnung mit einfließen.
$\sum_{l=0}^{N-1} f(a + \frac{1}{2} \cdot h + l \cdot h)$ sind die jeweiligen
mittleren Knoten der Intervalle. Davon gibt es $N$ Stück.
\subsection*{Teilaufgabe c)}
Diese Aufgabe ist nicht relevant, da Matlab nicht Klausurrelevant ist.

View file

@ -1,99 +0,0 @@
\section*{Aufgabe 5}
Zunächst ist nach der Familie von Quadraturformeln gefragt, für die gilt: ($p := $ Ordnung der QF)
\begin{align}
s = 3 \\
0 = c_1 < c_2 < c_3 \\
p \ge 4
\end{align}
Nach Satz 29 sind in der Familie genau die QFs, für die gilt: \\
Für alle Polynome $g(x)$ mit Grad $\le m-1 = 0$ gilt:
\begin{align}
\int_0^1 M(x) \cdot g(x) \mathrm{d}x = 0 \label{a3}
\end{align}
Da eine Quadraturformel höchstens Grad $2s=6$ (Satz 30) haben kann und es wegen
$c_1 = 0$ nicht die Gauss-Quadratur sein kann (Satz 31), kommt nur Ordnung $p=4$
und $p=5$ in Frage.
In dieser Aufgabe sind nur die symmetrischen QF, also die von Ordnung
$p=4$ explizit anzugeben. Für die QF von Ordnung $p=5$ hätte man nur
die Gewichte in Abhängigkeit der Knoten darstellen müssen und
eine Bedinung nur an die Knoten herleiten müssen.
\subsection*{Ordnung 4}
Es gilt $g(x) = c$ für eine Konstante $c$, da $\text{Grad}(g(x))=0$ ist.
Also ist \ref{a3} gleichbedeutend mit:
\begin{align}
\int_0^1 M(x) \cdot c \mathrm{d}x &= 0 \\
\Leftrightarrow c \cdot \int_0^1 M(x) \mathrm{d}x &= 0 \\
\Leftrightarrow \int_0^1 M(x) \mathrm{d}x &= 0 \\
\Leftrightarrow \int_0^1 (x-c_1)(x-c_2)(x-c_3) \mathrm{d}x &= 0 \\
\Leftrightarrow \frac{1}{4} - \frac{1}{3} \cdot (c_2 + c_3) + \frac{1}{2} \cdot c_2 \cdot c_3 &= 0 \\
\Leftrightarrow \frac{\frac{1}{4} - \frac{1}{3} \cdot c_3}
{\frac{1}{3} - \frac{1}{2} \cdot c_3} &= c_2
\end{align}
Natürlich müssen auch die Gewichte optimal gewählt werden. Dafür wird Satz 28 genutzt:
Sei $b^T = (b_1, b_2, b_3)$ der Gewichtsvektor. Sei zudem $C :=
\begin{pmatrix}
{c_1}^0 & {c_2}^0 & {c_3}^0 \\
{c_1}^1 & {c_2}^1 & {c_3}^1 \\
{c_1}^2 & {c_2}^2 & {c_3}^2
\end{pmatrix}
$. \\
Dann gilt: $C$ ist invertierbar und $b = C^{-1} \cdot
\begin{pmatrix}
1 \\
\frac{1}{2} \\
\frac{1}{3}
\end{pmatrix}
$.
Es gibt genau eine symmetrische QF in der Familie. Begründung: \\
Aus $c_1 = 0 $ folgt, dass $c_3 = 1$ ist. Außerdem muss $c_2 = \frac{1}{2} $ sein. Also sind die Knoten festgelegt. Da wir die Ordnung $\ge s = 3$ fordern, sind auch die Gewichte eindeutig. \\
Es handelt sich um die aus der Vorlesung bekannte Simpsonregel.
\subsection*{Ordnung 5}
Es gilt $g(x) = ax+c$ für Konstanten $a \neq 0, c$, da $\text{Grad}(g(x))=1$ ist.
Also ist \ref{a3} gleichbedeutend mit:
\begin{align}
\int_0^1 M(x) \cdot (ax+c) \mathrm{d}x &= 0 \\
\Leftrightarrow a \int_0^1 x M(x) \mathrm{d}x + c \int_0^1 M(x) \mathrm{d}x &= 0 \\
\Leftrightarrow a \int_0^1 x (x-c_1)(x-c_2)(x-c_3) \mathrm{d}x + c \int_0^1 (x-c_1)(x-c_2)(x-c_3) \mathrm{d}x &= 0 \\
\stackrel{c_1=0}{\Leftrightarrow} a \int_0^1 x^2(x-c_2)(x-c_3) \mathrm{d}x + c \int_0^1 x(x-c_2)(x-c_3) \mathrm{d}x &= 0 \\
\Leftrightarrow a \left (\frac{c_2 c_3}{3}-\frac{c_2}{4}-\frac{c_3}{4}+\frac{1}{5} \right ) + c \left ( \frac{c_2 c_3}{2}-\frac{c_2}{3}-\frac{c_3}{3}+\frac{1}{4} \right ) &= 0 \\
\Leftrightarrow \left (\frac{c_2 c_3}{3}-\frac{c_2}{4}-\frac{c_3}{4}+\frac{1}{5} \right ) + \underbrace{\frac{c}{a}}_{=: d} \left ( \frac{c_2 c_3}{2}-\frac{c_2}{3}-\frac{c_3}{3}+\frac{1}{4} \right ) &= 0
\end{align}
Nun habe ich \href{http://www.wolframalpha.com/input/?i=(1%2F5+-+c%2F4+%2B+(b+(-3+%2B+4+c))%2F12)%2B+d*(3+-+4+c+%2B+b+(-4+%2B+6+c))%2F12%3D0}{Wolfram|Alpha} lösen lassen:
\begin{align}
c_2 &= \frac{6-\sqrt{6}}{10} \approx 0.355\\
c_3 &= \frac{6+\sqrt{6}}{10} \approx 0.845
\end{align}
Wegen der Ordnungsbedingungen gilt nun:
\begin{align}
1 &= b_1 + b_2 + b_3\\
\frac{1}{2} &= b_2 \cdot \frac{6-\sqrt{6}}{10} + b_3 \cdot \frac{6+\sqrt{6}}{10}\\
\frac{1}{3} &= b_2 \cdot \left (\frac{6-\sqrt{6}}{10} \right )^2 + b_3 \cdot \left (\frac{6+\sqrt{6}}{10} \right )^2\\
\Leftrightarrow \frac{1}{3} - b_3 \cdot \left (\frac{6+\sqrt{6}}{10} \right )^2 &= b_2 \cdot \left (\frac{6-\sqrt{6}}{10} \right )^2\\
\Leftrightarrow \frac{\frac{1}{3} - b_3 \cdot \left (\frac{6+\sqrt{6}}{10} \right )^2}{\left (\frac{6-\sqrt{6}}{10} \right )^2} &= b_2\\
\Leftrightarrow b_2 &= \frac{100}{3 \cdot (6-\sqrt{6})^2} - b_3 \cdot \frac{(6+\sqrt{6})^2}{(6-\sqrt{6})^2}\\
\Rightarrow \frac{1}{2} &= \left ( \frac{100}{3 \cdot (6-\sqrt{6})^2} - b_3 \cdot \frac{(6+\sqrt{6})^2}{(6-\sqrt{6})^2} \right ) \cdot \frac{6-\sqrt{6}}{10} + b_3 \cdot \frac{6+\sqrt{6}}{10}\\
&= \left (\frac{10}{3 \cdot (6 - \sqrt{6})} - b_3 \cdot \frac{(6+\sqrt{6})^2}{10 \cdot (6 - \sqrt{6})} \right ) + b_3 \cdot \frac{6+\sqrt{6}}{10}\\
&= b_3 \cdot \left (\frac{6+\sqrt{6}}{10} - \frac{(6+\sqrt{6})^2}{10 \cdot (6 - \sqrt{6})} \right ) + \frac{10}{3 \cdot (6 - \sqrt{6})}\\
&= b_3 \cdot \left (\frac{30-(6+\sqrt{6})^2}{10 \cdot (6 - \sqrt{6})} \right ) + \frac{10}{3 \cdot (6 - \sqrt{6})}\\
\Leftrightarrow \frac{1}{2} - \frac{10}{3 \cdot (6 - \sqrt{6})} &= b_3 \cdot \left (\frac{30-(6+\sqrt{6})^2}{10 \cdot (6 - \sqrt{6})} \right )\\
\Leftrightarrow \frac{3 \cdot (6 - \sqrt{6}) - 20}{6\cdot (6 - \sqrt{6})} &= b_3 \cdot \left (\frac{30-(6+\sqrt{6})^2}{10 \cdot (6 - \sqrt{6})} \right )\\
\Leftrightarrow b_3 &= \frac{(3 \cdot (6 - \sqrt{6}) - 20) \cdot 10 \cdot (6 - \sqrt{6})}{6\cdot (6 - \sqrt{6}) \cdot (30-(6+\sqrt{6})^2)}\\
&= \frac{(3 \cdot (6 - \sqrt{6}) - 20) \cdot 5}{3 \cdot (30-(6+\sqrt{6})^2)}\\
&= \frac{15 \cdot (6 - \sqrt{6}) - 100}{90-3 \cdot (6+\sqrt{6})^2}\\
\Aboxed{b_3 &= \frac{16-\sqrt{6}}{36}} \approx 0.3764\\
\Aboxed{b_2 &= \frac{16+\sqrt{6}}{36}} \approx 0.5125\\
\stackrel{\text{Ordnungsbedinung 1}}{\Rightarrow} \Aboxed{b_1 &= \frac{1}{9}}\\
\frac{1}{4} &\stackrel{?}{=} \frac{16+\sqrt{6}}{36} \cdot \left (\frac{6-\sqrt{6}}{10} \right )^3 + \frac{16-\sqrt{6}}{36} \cdot \left (\frac{6+\sqrt{6}}{10} \right)^3 \text{ \cmark}\\
\frac{1}{5} &\stackrel{?}{=} \frac{16+\sqrt{6}}{36} \cdot \left (\frac{6-\sqrt{6}}{10} \right )^4 + \frac{16-\sqrt{6}}{36} \cdot \left (\frac{6+\sqrt{6}}{10} \right)^4 \text{ \cmark}\\
\frac{1}{6} &\stackrel{?}{=} \frac{16+\sqrt{6}}{36} \cdot \left (\frac{6-\sqrt{6}}{10} \right )^5 + \frac{16-\sqrt{6}}{36} \cdot \left (\frac{6+\sqrt{6}}{10} \right)^5 = \frac{33}{200} \text{ \xmark}
\end{align}

View file

@ -1,68 +0,0 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{pdfpages} % Signatureinbingung und includepdf
\usepackage[marginparwidth=3.0cm,marginparsep=-0.5cm]{geometry} % [margin=2.5cm]layout
\usepackage[pdftex]{hyperref} % links im text
\usepackage{color}
\usepackage{framed}
\usepackage{enumerate} % for advanced numbering of lists
\usepackage{marvosym} % checkedbox
\usepackage{wasysym}
\usepackage{braket} % for \Set{}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{gauss}
\usepackage{algorithm,algpseudocode}
\usepackage{parskip}
\usepackage{lastpage}
\usepackage{amsthm}
\usepackage{marginnote}
\usepackage{mathtools}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\title{Numerik Klausur 2{} - Musterlösung}
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Felix Benz-Baldas, Martin Thoma, Peter Merkert},
pdfkeywords = {Numerik, KIT, Klausur},
pdftitle = {\@title}
}
\pagestyle{fancy}
\lhead{\@title}
\rhead{Seite \thepage{} von \pageref{LastPage}}
}
\makeatother
\usepackage{fancyhdr}
\fancyfoot[C]{}
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\list{}{\leftmargin=4em
\rightmargin=\leftmargin
\settowidth{\itemindent}{\itshape#1}%
\labelwidth=\itemindent}
\item[\hskip\labelsep
\itshape
#1\@addpunct{.}]\ignorespaces
}{%
\popQED\endlist\@endpefalse
}
\makeatother
\begin{document}
\include{Aufgabe1}
\include{Aufgabe2}
\include{Aufgabe3}
\include{Aufgabe4}
\include{Aufgabe5}
\end{document}

View file

@ -1,8 +0,0 @@
SOURCE = Klausur2
make:
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.pyg

View file

@ -1,49 +0,0 @@
\section*{Aufgabe 1}
\subsection*{Teilaufgabe a)}
\paragraph{Gegeben:} Sei $A \in \mathbb{R}^{3 \times 3}$.
\paragraph{Gesucht:} Cholesky-Zerlegung $A = L \cdot L^T$
\paragraph{Rechnung:}
Erste Spalte:
\begin{align}
l_{11} &= \sqrt{a_{11}} \\
l_{21} &= \frac{a_{21}}{l_{11}}\\
l_{31} &= \frac{a_{31}}{l_{11}}\\
\end{align}
Zweite Spalte:
\begin{align}
l_{22} &= \sqrt{a_{22} - {l_{21}}^2}\\
l_{32} &= \frac{a_{32} -l_{21} \cdot l_{31}}{l_{22}} \\
\end{align}
Dritte Spalte:
\begin{align}
l_{33} &= \sqrt{a_{33}-{l_{32}^2}-{l_{31}}^2}
\end{align}
\subsection*{Teilaufgabe b)}
\begin{align}
l_{11} &= 2 \\
l_{21} &= 1 \\
l_{31} &= -2 \\
l_{22} &= 3 \\
l_{32} &= 1 \\
l_{33} &= 1 \\
\end{align}
Die restlichen Einträge sind $0$. ($L$ ist immer eine untere Dreiecksmatrix)
\subsection*{Teilaufgabe c)}
\begin{align}
A \cdot x = b \Leftrightarrow L \cdot L^T \cdot x = b \\
L \cdot c = b \label{a1}
\end{align}
Löse \ref{a1} mit Vorwärtssubstitution.
\begin{align}
L^T \cdot x = c \label{a2}
\end{align}
Löse \ref{a2} mit Rückwärtssubstitution.
\begin{align}
x_3 &= 3 \\
x_2 &= 1 \\
x_1 &= 2
\end{align}

View file

@ -1,17 +0,0 @@
\section*{Aufgabe 2}
\subsection*{Teilaufgabe a)}
\begin{align}
r_{ij} = a_{ij} - \sum_{k=1}^{i-1} l_{ik} \cdot r_{kj} \\ %TODO: Korrektheit überprüfen
l_{ij} = \frac{a_{ij} - \sum_{k=1}^{j-1} l_{ik} \cdot r_{kj}}{r_{jj}}
\end{align}
\begin{algorithm}
\begin{algorithmic}
\For{$d \in \Set{1, \dots n}$}
\State berechne d-te Zeile von $R$
\State berechne d-te Spalte von $L$
\EndFor
\end{algorithmic}
\end{algorithm}

View file

@ -1,33 +0,0 @@
\section*{Aufgabe 3}
\subsection*{Teilaufgabe a)}
\begin{enumerate}
\item Selbstabbildung: \\
Sei $x \in D := [1.75 , 2] = [\frac{7}{4}, \frac{8}{4}]$.
Dann:
\begin{align}
F(x) = 1 + \frac{1}{x} + \frac{1}{x^2} \le 1 + \frac{1}{1.75} + \frac{1}{1.75^2} = 1 + \frac{44}{49} \le 2 %TODO: schöner formulieren
\end{align}
und: \\
\begin{align}
F(x) = 1 + \frac{1}{x} + \frac{1}{x^2} \ge 1 + \frac{1}{2} + \frac{1}{4} = 1.75
\end{align}
\item Abgeschlossenheit: $D$ ist offentsichtlich abgeschlossen.
\item Kontraktion: \\ %TODO:
%\textbf{Behauptung:} $F(x)$ ist auf $A$ eine Kontraktion.
%\textbf{Beweis:}
%z.Z.: $\exists L \in [0, 1): \forall x,y \in A: || F(x) - F(y) || \leq L \cdot || x - y||$
Hier ist der Mittelwertsatz der Differentialrechnung von Nutzen.\\
$F$ ist Lipschitz-stetig auf $D$ und für alle $x \in D$ gilt: \\
\begin{align}
|F'(x)| = |-\frac{1}{x^2}-2 \cdot \frac{1}{x^3}| \le \frac{240}{343} =: \theta < 1
\end{align}
Also gilt auch $\forall x,y \in D $:
\begin{align}
|F(x) - F(y)| \le \theta \cdot |x - y|
\end{align}
Somit ist die Lipschitz- bzw. Kontraktions-Konstante $\theta$.
\end{enumerate}
Insgesamt folgt, dass $F$ die Voraussetzungen des Banachschen Fixpunktsatzes erfüllt.

View file

@ -1,8 +0,0 @@
\section*{Aufgabe 4}
\begin{align*}
I &= \int_0^1 \frac{1}{1+4x} dx\\
&= \int_0^{0.5} \frac{1}{1+4x} dx +\int_{0.5}^{1} \frac{1}{1+4x} dx\\
&= (0.5 - 0) \cdot \frac{f(0) + f(0.5)}{2} + (1 - 0.5) \cdot \frac{f(1) + f(0.5)}{2} \\
&= \frac{7}{15}
\end{align*}

View file

@ -1,21 +0,0 @@
\section*{Aufgabe 5}
\subsection*{Teilaufgabe a}
Eine Quadraturformel $(b_i, c_i)_{i=1, \dots, s}$ hat die Ordnung
$p$, falls sie exakte Lösungen für alle Polynome vom Grad $\leq p -1$
liefert.
\subsection*{Teilaufgabe b}
Für die ersten 3. Ordnungsbedingungen gilt:
\begin{align*}
1 = \sum_{i = 0}^{s} b_i \\
\frac{1}{2} = \sum_{i = 0}^{s} b_i \cdot c_i \\
\frac{1}{3} = \sum_{i = 0}^{s} b_i \cdot c_i^2
\end{align*}
\subsection*{Teilaufgabe c}
Wähle die Simpson-Regel, also $c_1=0, c_2 = \frac{1}{2}, c_3 = 1$ und
$b_1 = b_3 = \frac{1}{6}$ und $b_2 = \frac{4}{6}$.
Überprüfe nun Ordnungsbedingungen 1-4 $\Rightarrow$ Simpson-Regel hat Ordnung 4
Überprüfe Ordnungsbedingung 5 $\Rightarrow$ Simpson-Regel hat nicht Ordnung 5. %TODO ausführlicher

View file

@ -1,48 +0,0 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{pdfpages} % Signatureinbingung und includepdf
\usepackage{geometry} % [margin=2.5cm]layout
\usepackage[pdftex]{hyperref} % links im text
\usepackage{color}
\usepackage{framed}
\usepackage{enumerate} % for advanced numbering of lists
\usepackage{marvosym} % checkedbox
\usepackage{wasysym}
\usepackage{braket} % for \Set{}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{gauss}
\usepackage{algorithm,algpseudocode}
\usepackage{parskip}
\usepackage{lastpage}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\title{Numerik Klausur 3 - Musterlösung}
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Felix Benz-Baldas, Martin Thoma, Peter Merkert},
pdfkeywords = {Numerik, KIT, Klausur},
pdftitle = {\@title}
}
\pagestyle{fancy}
\lhead{\@title}
\rhead{Seite \thepage{} von \pageref{LastPage}}
}
\makeatother
\usepackage{fancyhdr}
\fancyfoot[C]{}
\begin{document}
\input{Aufgabe1}
\input{Aufgabe2}
\input{Aufgabe3}
\input{Aufgabe4}
\input{Aufgabe5}
\end{document}

View file

@ -1,8 +0,0 @@
SOURCE = Klausur3
make:
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.pyg

View file

@ -1,86 +0,0 @@
\section*{Aufgabe 1}
\textbf{Gegeben:}
\[A =
\begin{pmatrix}
6 & -6 & 0 \\
-3 & 7 & 2 \\
2 & 4 & 1
\end{pmatrix}, \;\;\;
b =\begin{pmatrix}
0 \\
8 \\
8
\end{pmatrix}\]
\textbf{Aufgabe:} $Ax = b$ mit Gaußelimination und Spaltenpivotwahl lösen
\textbf{Lösung:}
\begin{align}
\begin{gmatrix}[p]
6 & -6 & 0 & 0\\
-3 & 7 & 2 & 8\\
2 & 4 & 1 & 8
\rowops
\mult{0}{\cdot \frac{1}{6}}
\end{gmatrix}
&\leadsto
\begin{gmatrix}[p]
1 & -1 & 0 & 0\\
-3 & 7 & 2 & 8\\
2 & 4 & 1 & 8
\rowops
\add[3]{0}{1}
\add[-2]{0}{2}
\end{gmatrix}\\
&\leadsto
\begin{gmatrix}[p]
1 & -1 & 0 & 0\\
0 & 4 & 2 & 8\\
0 & 6 & 1 & 8
\rowops
\swap{1}{2}
\end{gmatrix}\\
&\leadsto
\begin{gmatrix}[p]
1 & -1 & 0 & 0\\
0 & 6 & 1 & 8\\
0 & 4 & 2 & 8
\rowops
\mult{1}{\cdot \frac{1}{6}}
\add[-4]{1}{2}
\end{gmatrix}\\
&\leadsto
\begin{gmatrix}[p]
1 & -1 & 0 & 0\\
0 & 1 & \frac{1}{6} & \frac{4}{3}\\
0 & 0 & \frac{4}{3} & \frac{8}{3}
\rowops
\mult{2}{\cdot \frac{3}{4}}
\end{gmatrix}\\
&\leadsto
\begin{gmatrix}[p]
1 & -1 & 0 & 0\\
0 & 1 & \frac{1}{6} & \frac{4}{3}\\
0 & 0 & 1 & 2
\rowops
\add[\cdot \frac{-1}{6}]{2}{1}
\end{gmatrix}\\
&\leadsto
\begin{gmatrix}[p]
1 & -1 & 0 & 0\\
0 & 1 & 0 & 1\\
0 & 0 & 1 & 2
\rowops
\add[]{1}{0}
\end{gmatrix}\\
&\leadsto
\begin{gmatrix}[p]
1 & 0 & 0 & 1\\
0 & 1 & 0 & 1\\
0 & 0 & 1 & 2
\end{gmatrix}
\end{align}
$\Rightarrow x = \begin{pmatrix}1 & 1 & 2\end{pmatrix}^T$ löst das LGS.

View file

@ -1,14 +0,0 @@
\section*{Aufgabe 2}
Die \emph{Kondition} eines Problems ist die Frage, wie sich kleine Störungen
der Eingabegrößen unabhängig vom gewählten Algorithmus auf die
Lösung des Problems auswirken.
Bei dem lösen von linearen Gleichungssystemen sind die Eingabegrößen
die Koeffizientenmatrix $A$ und der Vektor $b$.
Der Begriff \emph{Stabilität} ist auf einen konkreten Algorithmus
zu beziehen und beschäftigt sich mit der Frage, wie sich Rundungsfehler,
welche während der Durchführung des Algorithmus entstehen, auf
die Lösung auswirken.
Die Stabilität eines Algorithmus bezeichnet, wie stark der Algorithmus das Ergebnis verfälschen kann. Man kann also die Stabilität der Gauß-Elimination angeben. Man kann allerdings nicht von einer Stabilität des Problems $A \cdot x = b$ sprechen.

View file

@ -1,4 +0,0 @@
\section*{Aufgabe 3}
Diese Aufgabe ist identisch zu Aufgabe 3, Klausur3.
Die Lösung ist bei Klausur3 zu finden.

View file

@ -1,4 +0,0 @@
\section*{Aufgabe 4}
Diese Aufgabe ist identisch zu Aufgabe 3, Klausur2.
Die Lösung ist bei Klausur2 zu finden.

View file

@ -1,32 +0,0 @@
\section*{Aufgabe 5}
\subsection*{Teilaufgabe a}
Eine Quadraturformel $(b_i, c_i)_{i=1,\dots,s}$ hat die Ordnung
$p$, falls sie exakte Lösungenfür alle Polynome vom Grad $\leq p-1$ liefern.\footnote{Kapitel 4, S. 4 des Skripts}
Die Ordnungsbedinungen liefern ein hinreichendes Kriterium zum Überprüfen
der Ordnung einer Quadraturformel.
Für die Mittelpunktsregel $c_1 = \frac{1}{2}, b_1 = 1$ gilt:
\begin{align}
\frac{1}{1} &\stackrel{?}{=} b_1 = 1 \text{ \cmark}\\
\frac{1}{2} &\stackrel{?}{=} b_1 c_1 = \frac{1}{2} \text{ \cmark}\\
\frac{1}{3} &\stackrel{?}{=} b_1 c_1^2 = \frac{1}{4} \text{ \xmark}
\end{align}
Die Ordnung der Mittelpunktsregel ist also $p=2$.
\subsection*{Teilaufgabe b}
\paragraph*{Aufgabe:}
Das Integral
\[I = \int_0^1 \frac{1}{1+4x} \mathrm{d}x\]
soll näherungsweise mit der Mittelpunktsregel, angwendet auf eine
äquistante Unterteilung des Intervalls $[0,1]$ in zwei Teilintervalle
angewendet werden.
\paragraph*{Lösung:}
\begin{align}
I &= \int_0^\frac{1}{2} \frac{1}{1+4x} \mathrm{d}x + \int_\frac{1}{2}^1 \frac{1}{1+4x} \mathrm{d}x\\
&\approx \frac{1}{2} \cdot \frac{1}{1+1} + \frac{1}{2} \frac{1}{1+ 4 \cdot \frac{3}{4}} \\
&= \frac{3}{8}
\end{align}

View file

@ -1,48 +0,0 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{pdfpages} % Signatureinbingung und includepdf
\usepackage{geometry} % [margin=2.5cm]layout
\usepackage[pdftex]{hyperref} % links im text
\usepackage{color}
\usepackage{framed}
\usepackage{enumerate} % for advanced numbering of lists
\usepackage{marvosym} % checkedbox
\usepackage{wasysym}
\usepackage{braket} % for \Set{}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{gauss}
\usepackage{algorithm,algpseudocode}
\usepackage{parskip}
\usepackage{lastpage}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\title{Numerik Klausur 4 - Musterlösung}
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Martin Thoma, Peter, Felix},
pdfkeywords = {Numerik, KIT, Klausur},
pdftitle = {\@title}
}
\pagestyle{fancy}
\lhead{\@title}
\rhead{Seite \thepage{} von \pageref{LastPage}}
}
\makeatother
\usepackage{fancyhdr}
\fancyfoot[C]{}
\begin{document}
\input{Aufgabe1}
\input{Aufgabe2}
\input{Aufgabe3}
\input{Aufgabe4}\clearpage
\input{Aufgabe5}
\end{document}

View file

@ -1,8 +0,0 @@
SOURCE = Klausur4
make:
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.pyg

View file

@ -1,106 +0,0 @@
\section*{Aufgabe 1}
\paragraph{Gegeben:}
\[A = \begin{pmatrix}
2 & 3 & -1\\
-6 & -5 & 0\\
2 & -5 & 6
\end{pmatrix},\;\;\; b = \begin{pmatrix}20\\-41\\-15\end{pmatrix}\]
\paragraph{LR-Zerlegung:}
\begin{align}
&&A^{(0)} &= \begin{gmatrix}[p]
2 & 3 & -1\\
-6 & -5 & 0\\
2 & -5 & 6
\rowops
\swap{0}{1}
\end{gmatrix}\\
P^{(1)} &= \begin{pmatrix}
0 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}
&A^{(1)} &=
\begin{gmatrix}[p]
-6 & -5 & 0\\
2 & 3 & -1\\
2 & -5 & 6
\rowops
\add[\cdot \frac{1}{3}]{0}{1}
\add[\cdot \frac{1}{3}]{0}{2}
\end{gmatrix}\\
L^{(2)} &=\begin{pmatrix}
1 & 0 & 0\\
\nicefrac{1}{3} & 1 & 0\\
\nicefrac{1}{3} & 0 & 1
\end{pmatrix},
& A^{(2)} &= \begin{gmatrix}[p]
-6 & -5 & 0\\
0 & \frac{4}{3} & -1\\
0 & -\frac{20}{3} & 6
\rowops
\swap{1}{2}
\end{gmatrix}\\
P^{(3)} &= \begin{pmatrix}
1 & 0 & 0\\
0 & 0 & 1\\
0 & 1 & 0
\end{pmatrix},
& A^{(3)} &= \begin{gmatrix}[p]
-6 & -5 & 0\\
0 & -\frac{20}{3} & 6\\
0 & \frac{4}{3} & -1
\rowops
\add[\cdot \frac{1}{5}]{1}{2}
\end{gmatrix}\\
L^{(4)} &= \begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & \nicefrac{1}{5} & 1
\end{pmatrix},
& A^{(4)} &= \begin{gmatrix}[p]
-6 & -5 & 0\\
0 & -\frac{20}{3} & 6\\
0 & 0 & \nicefrac{1}{5}
\end{gmatrix} =:R
\end{align}
Es gilt nun:
\begin{align}
P :&= P^{(3)} \cdot P^{(1)}\\
&= \begin{pmatrix}
1 & 0 & 0\\
0 & 0 & 1\\
0 & 1 & 0
\end{pmatrix} \cdot \begin{pmatrix}
0 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix} \\
&=
\begin{pmatrix}
0 & 1 & 0\\
0 & 0 & 1\\
1 & 0 & 0
\end{pmatrix}\\
L^{(4)} \cdot P^{(3)} \cdot L^{(2)} \cdot P^{(1)} \cdot A &= R\\
L^{-1} &= L^{(4)} \cdot \hat{L_1}\\
\hat{L_1} &= P^{(3)} \cdot L^{(2)} \cdot (P^{(3)})^{-1}\\
&= P^{(3)} \cdot L^{(2)} \cdot P^{(3)}\\
&= \begin{pmatrix}
1 & 0 & 0\\
\nicefrac{1}{3} & 1 & 0\\
\nicefrac{1}{3} & 0 & 1
\end{pmatrix}\\
L &= (L^{(4)} \cdot \hat{L_1})^{-1}\\
&= \begin{pmatrix}
1 & 0 & 0\\
-\frac{1}{3} & 1 & 0\\
-\frac{1}{3} & -\frac{1}{5} & 1
\end{pmatrix}
\end{align}
Überprüfung mit \href{http://www.wolframalpha.com/input/?i=%7B%7B1%2C+0%2C+0%7D%2C+%7B-1%2F3%2C+1%2C+0%7D%2C+%7B-1%2F3%2C+-1%2F5%2C+1%7D%7D*%7B%7B-6%2C-5%2C0%7D%2C%7B0%2C-20%2F3%2C6%7D%2C%7B0%2C0%2C1%2F5%7D%7D}{Wolfram|Alpha}.

View file

@ -1,78 +0,0 @@
\section*{Aufgabe 2}
Zeige die Aussage für $2\times2$ Matrizen durch Gauß-en mit
Spaltenpivotwahl.
\subsection*{Lösung}
\subsubsection*{Behauptung:}
Für alle tridiagonalen Matrizen gilt:
\begin{enumerate}
\item[(i)] Die Gauß-Elimination erhält die tridiagonale Struktur
\item[(ii)] $\rho_n(A) := \frac{\alpha_\text{max}}{\max_{i,j} |a_{ij}|} \leq 2$
\end{enumerate}
\subsubsection*{Beweis:}
\paragraph{Teil 1: (i)}
\begin{align}
A &= \begin{gmatrix}[p]
* & * & & \\
* & \ddots & \ddots & \\
& \ddots & \ddots & * \\
& & * & *
\rowops
\add[\cdot \frac{-a_{21}}{a_{11}}]{0}{1}
\end{gmatrix}
\end{align}
Offensichtlich ändert diese Operation nur Zeile 2. $a_{21}$ wird zu 0,
$a_{22}$ ändert sich irgendwie, alles andere bleibt unverändert.
Die gesammte Matrix ist keine tridiagonale Matrix mehr, aber die
um Submatrix in $R^{(n-1) \times (n-1)}$ ist noch eine.
Muss man zuvor Zeile 1 und 2 tauschen (andere Zeilen kommen nicht in
Frage), so ist später die Stelle $a_{21} = 0$, $a_{22}$ ändert sich
wieder irgendwie und $a_{23}$ ändert sich auch. Dies ändert aber nichts
an der tridiagonalen Struktur der Submatrix.
\paragraph{Teil 2: (ii) für $A \in \mathbb{R}^{2 \times 2}$}
Sei $\begin{pmatrix}a_{11} & a_{12}\\a_{21} & a_{22} \end{pmatrix} \in \mathbb{R}^{2 \times 2}$
beliebig.
O.B.d.A sei die Spaltenpivotwahl bereits durchgeführt, also $|a_{11}| \geq |a_{21}|$.
Nun folgt:
\begin{align}
\begin{gmatrix}[p]
a_{11} & a_{12}\\
a_{21} & a_{22}
\rowops
\add[\cdot \frac{-a_{21}}{a_{11}}]{0}{1}
\end{gmatrix}\\
\leadsto
\begin{gmatrix}[p]
a_{11} & a_{12}\\
0 & a_{22} - \frac{a_{12} \cdot a_{21}}{a_{11}}
\end{gmatrix}
\end{align}
Wegen $|a_{11}| \geq |a_{21}|$ gilt:
\begin{align}
\|\frac{a_{21}}{a_{11}}\| \leq 1
\end{align}
Also insbesondere
\begin{align}
\underbrace{a_{22} - a_{12} \cdot \frac{a_{21}}{a_{11}}}_{\leq \alpha_\text{max}} \leq 2 \cdot \max_{i,j}|a_{ij}|
\end{align}
Damit ist Aussage (ii) für $A \in \mathbb{R}^{2 \times 2}$ gezeigt.
\paragraph{Teil 3: (ii) für allgemeinen Fall}
Aus Teil 2 folgt die Aussage auch direkt für größere Matrizen.
Der worst case ist, wenn man beim Addieren einer Zeile auf eine
andere mit $\max_{i,j}|a_{ij}|$ multiplizieren muss um das erste nicht-0-Element
der Zeile zu entfernen und das zweite auch $\max_{i,j}|a_{ij}|$ ist.
Dann muss man aber im nächsten schritt mit einem Faktor $\leq \frac{1}{2}$
multiplizieren, erhält also nicht einmal mehr $2 \cdot \max_{i,j}|a_{ij}|$.

View file

@ -1,24 +0,0 @@
\section*{Aufgabe 3}
\subsection*{Teilaufgabe i}
relativer Fehler:
\begin{align}
\frac{ | \frac{x}{y} - \frac{x \cdot (1 + \varepsilon_x)}{y \cdot (1 + \varepsilon_y)}|}{|\frac{x}{y}|}
&= \frac{| \frac{x(1+\varepsilon_y) - x (1+\varepsilon_x)}{y(1+\varepsilon_y)} |}{|\frac{x}{y}|} \\
&= \frac{| \frac{x(\varepsilon_y-\varepsilon_x)}{y(1+\varepsilon_y)} |}{|\frac{x}{y}|} \\
&= \left |\frac{\varepsilon_y - \epsilon_x }{1 + \varepsilon_y} \right |\\
&\le \frac{|\varepsilon_y | + | \varepsilon_x |}{|1 + \varepsilon_y|} \le \frac{2 \cdot \text{eps}}{|1 + \varepsilon_y|} \\
&\approx 2 \cdot \text{eps}
\end{align}
Der letzte Ausdruck ist ungefähr gleich $2 \cdot \text{eps}$, da $1 + \epsilon_y$ ungefähr gleich $1$ ist.
Der relative Fehler kann sich also maximal verdoppeln.
\subsection*{Teilaufgabe ii}
Die zweite Formel ist vorzuziehen, also $f(x) = -\ln (x + \sqrt{x^2-1})$, da es bei Subtraktion zweier annähernd gleich-großer Zahlen zur Stellenauslöschung kommt. Bei der ersten Formel, also $f(x) = \ln (x - \sqrt{x^2-1})$, tritt genau dieses Problem auf: $x$ und $\sqrt{x^2-1}$ sind für große $x$ ungefähr gleich groß. \\
Bei der zweiten Formel tritt das Problem nicht auf: $x$ ist positiv und $\sqrt{x^2 - 1}$ auch, also gibt es in dem Ausdruck keine Subtraktion zweier annähernd gleich-großer Zahlen.
Außerdem ändert sich $\ln(x)$ stärker, je näher $x$ bei 0 ist. Es ist
also auch wegen der Ungenauigkeit der Berechnung des $\ln$ besser,
weiter von $0$ entfernt zu sein.

View file

@ -1,9 +0,0 @@
\section*{Aufgabe 4}
TODO
\begin{itemize}
\item Klausur 3, Aufgabe 3 ist ähnlich
\item Klausur 4, Aufgabe 3 ist ähnlich
\item Klausur 5, Aufgabe 4 ist ähnlich
\item Klausur 6, Aufgabe 3 ist ähnlich
\end{itemize}

View file

@ -1,51 +0,0 @@
\section*{Aufgabe 5}
\subsection*{Aufgabe}
Bestimme alle Quadraturformeln mit $s=3$ und Knoten
$0 = c_1 < c_2, c_3$ und Ordnung $p \geq 4$.
Schreiben Sie ein Programm in Pseudocode, welches zu vorgegebenem
$c_2$ den Knoten $c_3$ und die Gewichte $b_i$ möglichst effizient
berechnet.
Wie viele symmetrische Quadraturformeln gibt es mit diesen Eigneschaften?
\subsection*{Lösung}
Da $c_1 = 0$ kann es keine Gauß-Quadraturformel sein. Daher kann
die Ordnung nicht $2 \cdot s = 6$ sein. Interessant sind also
\begin{itemize}
\item[(A)] Symmetrische Quadraturformeln der Ordnung 4
\item[(B)] Unsymmetrische Quadraturformeln der Ordnung 4
\item[(C)] Unsymmetrische Quadraturformeln der Ordnung 5
\end{itemize}
Die Simpson-Regel mit $c_1 = 0, c_2 = \frac{1}{2}$ und $c_3 = 1$
mit $b_1 = b_3 = \frac{1}{6}$ und $b_2 = \frac{4}{6}$ ist die einzige
symmetrische Quadraturformel in (A).
Für (B) müssen die Ordnungsbedingungen gelten:
\begin{align}
\nicefrac{1}{1} &\stackrel{!}{=} b_1 + b_2 + b_3\label{eq:i}\\
\nicefrac{1}{2} &\stackrel{!}{=} b_2 \cdot c_2 + b_3 c_3\label{eq:ii}\\
\nicefrac{1}{3} &\stackrel{!}{=} b_2 \cdot c_2^2 + b_3 c_3^2\label{eq:iii}\\
\nicefrac{1}{4} &\stackrel{!}{=} b_2 \cdot c_2^3 + b_3 c_3^3\label{eq:iv}\\
\stackrel{\ref{eq:ii}}{\Rightarrow} \frac{\nicefrac{1}{2} - b_3 c_3}{c_2}&\stackrel{!}{=} b_2 \label{eq:ii2}\\
\stackrel{\ref{eq:ii2} \text{ in } \ref{eq:iii}}{\Rightarrow} \nicefrac{1}{3} &\stackrel{!}{=} (\nicefrac{1}{2} - b_3 c_3) \cdot c_2 + b_3 c_3^2\label{eq:iii2}\\
\Leftrightarrow \nicefrac{1}{3} - \nicefrac{1}{2} \cdot c_2 &\stackrel{!}{=} b_3 (- c_3 c_2 + c_3^2)\\
\Leftrightarrow \frac{\nicefrac{1}{3} - \nicefrac{1}{2} \cdot c_2}{c_3^2 - c_3 c_2} &\stackrel{!}{=} b_3 \label{eq:iii3}\\
\stackrel{\ref{eq:ii2} \text{ in } \ref{eq:iv}}{\Rightarrow} \nicefrac{1}{4} &\stackrel{!}{=} (\nicefrac{1}{2} - b_3 c_3) \cdot c_2^2 + b_3 c_3^3\label{eq:iv2}\\
\Leftrightarrow \nicefrac{1}{4} - \nicefrac{1}{2} c_2^2&\stackrel{!}{=} b_3 (c_3^3 - c_3 \cdot c_2^2) \label{eq:iv2}\\
\stackrel{\ref{eq:iii3} \text{ in } \ref{eq:iv2}}{\Rightarrow} \nicefrac{1}{4} - \nicefrac{1}{2} c_2^2&\stackrel{!}{=} \frac{\nicefrac{1}{3} - \nicefrac{1}{2} \cdot c_2}{c_3^2 - c_3 c_2} (c_3^3 - c_3 \cdot c_2^2)\\
\Leftrightarrow \frac{1}{2} \left (\frac{1}{2} - c_2^2 \right ) &= \frac{(\nicefrac{1}{3} - \nicefrac{1}{2} \cdot c_2)(c_3^2 - c_2^2)}{c_3 - c_2}\\
\Leftrightarrow \frac{1}{2} - c_2^2 &= (\nicefrac{2}{3} - c_2)(c_3 + c_2)\\
\Leftrightarrow \frac{1}{2} - c_2^2 &= \nicefrac{2}{3} c_3 + \nicefrac{2}{3} c_2 - c_2 c_3 - c_2^2\\
\Leftrightarrow \frac{1}{2} - \frac{2}{3} c_2 &= \nicefrac{2}{3} c_3- c_2 c_3\\
\Leftrightarrow \frac{1}{2} - \frac{2}{3} c_2 &= c_3(\nicefrac{2}{3}- c_2)\\
\Leftrightarrow c_3 &= \frac{\frac{1}{2} - \frac{2}{3} c_2}{\nicefrac{2}{3}- c_2} = \frac{2c_2-\nicefrac{3}{2}}{3c_2 - 2}\\
\end{align}
Für (C) muss zusätzlich gelten:
\begin{align}
\nicefrac{1}{5} &\stackrel{!}{=} b_2 \cdot c_2^4 + b_3 c_3^4
\end{align}
TODO

View file

@ -1,49 +0,0 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{pdfpages} % Signatureinbingung und includepdf
\usepackage{geometry} % [margin=2.5cm]layout
\usepackage[pdftex]{hyperref} % links im text
\usepackage{color}
\usepackage{framed}
\usepackage{enumerate} % for advanced numbering of lists
\usepackage{marvosym} % checkedbox
\usepackage{wasysym}
\usepackage{braket} % for \Set{}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{gauss}
\usepackage{algorithm,algpseudocode}
\usepackage{parskip}
\usepackage{lastpage}
\usepackage{units}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\title{Numerik Klausur 5 - Musterlösung}
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Martin Thoma, Peter, Felix},
pdfkeywords = {Numerik, KIT, Klausur},
pdftitle = {\@title}
}
\pagestyle{fancy}
\lhead{\@title}
\rhead{Seite \thepage von \pageref{LastPage}}
}
\makeatother
\usepackage{fancyhdr}
\fancyfoot[C]{}
\begin{document}
\input{Aufgabe1}
\input{Aufgabe2}\clearpage
\input{Aufgabe3}\clearpage
\input{Aufgabe4}
\input{Aufgabe5}
\end{document}

View file

@ -1,8 +0,0 @@
SOURCE = Klausur5
make:
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.pyg

View file

@ -1,88 +0,0 @@
\section*{Aufgabe 1}
\textbf{Gegeben:}
\[
A = \begin{pmatrix}
1 & 2 & 3\\
2 & 8 & 14\\
3 & 14 & 34
\end{pmatrix}\]
\textbf{Aufgabe:} Durch Gauß-Elimination die Cholesky-Zerlegung $A = \overline{L} \overline{L}^T$
berechnen
\begin{align*}
A &=
\begin{gmatrix}[p]
1 & 2 & 3\\
2 & 8 & 14\\
3 & 14 & 34
\rowops
\add[\cdot (-2)]{0}{1}
\add[\cdot (-3)]{0}{2}
\end{gmatrix}\\
\leadsto
L^{(1)} &=
\begin{pmatrix}
1 & 0 & 0\\
-2 & 1 & 0\\
-3 & 0 & 1
\end{pmatrix},&
A^{(1)} &=
\begin{gmatrix}[p]
1 & 2 & 3\\
0 & 4 & 8\\
0 & 8 & 25
\rowops
\add[\cdot (-2)]{1}{2}
\end{gmatrix}\\
\leadsto
L^{(2)} &=
\begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & -2 & 1
\end{pmatrix},&
A^{(2)} &=
\begin{gmatrix}[p]
1 & 2 & 3\\
0 & 4 & 8\\
0 & 0 & 9
\end{gmatrix} =: R\\
L &= (L^{(2)} \cdot L^{(1)})^{-1}\footnotemark
&L &= \begin{pmatrix}
1 & 0 & 0\\
2 & 1 & 0\\
3 & 2 & 1
\end{pmatrix}
\end{align*}
\footnotetext{Da dies beides Frobeniusmatrizen sind, kann einfach die negierten Elemente unter der Diagonalmatrix auf die Einheitsmatrix addieren um das Ergebnis zu erhalten}
Nun gilt:
\begin{align}
A &= LR = L (DL^T)\\
\Rightarrow A &= \underbrace{(L D^\frac{1}{2})}_{=: \overline{L}} (D^\frac{1}{2} L^T)\\
\begin{pmatrix}d_1 &0&0\\0&d_2&0\\0&0&d_3\end{pmatrix} \cdot
\begin{pmatrix}
1 & 2 & 3\\
0 & 1 & 2\\
0 & 0 & 1
\end{pmatrix}
&= \begin{pmatrix}
1 & 2 & 3\\
0 & 4 & 8\\
0 & 0 & 9
\end{pmatrix}\\
\Rightarrow D &= \begin{pmatrix}1 &0&0\\0&4&0\\0&0&9\end{pmatrix}\\
\Rightarrow D^\frac{1}{2} &= \begin{pmatrix}1 &0&0\\0&2&0\\0&0&3\end{pmatrix}\\
\overline{L} &= \begin{pmatrix}
1 & 0 & 0\\
2 & 1 & 0\\
3 & 2 & 1
\end{pmatrix} \cdot \begin{pmatrix}1 &0&0\\0&2&0\\0&0&3\end{pmatrix}\\
&= \begin{pmatrix}
1 & 0 & 0\\
2 & 2 & 0\\
3 & 4 & 3
\end{pmatrix}
\end{align}

View file

@ -1,75 +0,0 @@
\section*{Aufgabe 2}
\subsection*{Teilaufgabe i}
Es gilt:
\begin{align}
2x - e^{-x} &= 0\\
\Leftrightarrow 2x &= e^{-x}\\
\end{align}
Offensichtlich ist $g(x) := 2x$ streng monoton steigend und $h(x) := e^{-x}$ streng
monoton fallend.
Nun gilt: $g(0) = 0 < 1 = e^0 = h(0)$. Das heißt, es gibt keinen
Schnittpunkt für $x \leq 0$.
Außerdem: $g(1) = 2$ und $h(1) = e^{-1} = \frac{1}{e} < 2$.
Das heißt, für $x \geq 1$ haben $g$ und $h$ keinen Schnittpunkt.
Da $g$ und $h$ auf $[0,1]$ stetig sind und $g(0) < h(0)$ sowie $g(1) > h(1)$
gilt, müssen sich $g$ und $h$ im Intervall mindestens ein mal schneiden.
Da beide Funktionen streng monoton sind, schneiden sie sich genau
ein mal.
Ein Schnittpunkt der Funktion $g,h$ ist äquivalent zu einer
Nullstelle der Funktion $f$. Also hat $f$ genau eine Nullstelle
und diese liegt in $[0,1]$.
\subsection*{Teilaufgabe ii}
\begin{align}
2x - e^{-x} &= 0\\
\Leftrightarrow 2x &= e^{-x}\\
\Leftrightarrow x &= \frac{1}{2} \cdot e^{-x} = F_1(x) \label{a2iif1}\\
\stackrel{x \in \mathbb{R}^+}{\Rightarrow} \ln(2x) &= -x\\
\Leftrightarrow x &= - \ln(2x) = F_2(x)\label{a2iif2}
\end{align}
Gleichung \ref{a2iif1} zeigt, dass der Fixpunkt von $F_1$ mit der
Nullstelle von $f$ übereinstimmt.
Gleichung \ref{a2iif2} zeigt, dass der Fixpunkt von $F_1$ mit der
Nullstelle von $f$ übereinstimmt. Da es nur in $[0,1]$ eine Nullstelle
gibt (vgl. Teilaufgabe i), ist die Einschränkung von $x$ auf $\mathbb{R}^+$
irrelevant.
Man sollte $F_1$ zur Fixpunktiteration verwenden, da $\ln(x)$ nur für
$x>0$ definiert ist. Bei der Iteration kommt man aber schnell in
einen Bereich, der nicht erlaubt ist (das erlaubte Intervall ist klein;
Rechenungenauigkeit)
$F_1$ ist auf $[0,1]$ eine Kontraktion mit Kontraktionszahl $\theta = \frac{1}{2}$:
Nach dem Mittelwertsatz der Differentialrechnung ex. ein $\xi \in (a,b)$ mit $ 0 \leq a < b \leq 1$, sodass
gilt:
\begin{align}
\frac{F(b) - F(a)}{b-a} &= f'(\xi) \\
\Leftrightarrow \frac{F(b) - F(a)}{b-a} &= - \frac{1}{2} e^{- \xi} \\
\Leftrightarrow \frac{\|F(b) - F(a)\|}{\|b-a\|} &= \frac{1}{2} \frac{1}{e^{\xi}} < \frac{1}{2 e^a} \\
\Leftrightarrow \|F(b) - F(a)\| &< \frac{1}{2 e^a} |b-a|\\
\Rightarrow \forall x, y \in [0,1]: |F(x) - F(y)| &< \frac{1}{2} |x-y|
\end{align}
Die Ableitung $F_2' = -\frac{1}{x}$. Da $F_2(1) \neq 1$ ist $x^* \neq 1$.
Also ist $|F_2'(x^*)| > 1$. Deshalb konvergiert das Iterationsverfahren
definiert durch $F_2$ nicht gegen $x^*$ für Startwerte ungleich $x^*$.
Gegen $F_2$ spricht auch, dass $\log$ nur auf $\mathbb{R}^+$ definiert
ist. Das kann bei Rundungsfehlern eventuell zu einem Fehler führen.
(vgl. Python-Skript)
\subsection*{Teilaufgabe iii}
\[x_{k+1} = x_k - \frac{2x_k - e^{-x_k}}{2 + e^{-x_k}}\]
Laut \href{http://www.wolframalpha.com/input/?i=2x-e%5E(-x)%3D0}{Wolfram|Alpha} ist die Lösung etwa 0.35173371124919582602

View file

@ -1,37 +0,0 @@
\section*{Aufgabe 3}
\begin{table}[H]
\begin{tabular}{l|l|l|l|l}
$f_i$ & 8 & 3 & 4 & 8 \\ \hline
$x_i$ & -1 & 0 & 1 & 3 \\
\end{tabular}
\end{table}
\subsection*{Teilaufgabe i}
\begin{align}
p(x) = \sum_{i=0}^3 f_i \cdot L_i(x)
\end{align}
mit
\begin{align}
L_0(x) &= \frac{(x-x_1)(x-x_2)(x-x_3)}{(x_0 - x_1)(x_0-x_2)(x_0-x_3)}
= \ldots = \frac{x^3 - 4x^2 + 3x}{-8} \\
L_1(x) &= \frac{x^3 - 3x^2 - x + 3}{3} \\
L_2(x) &= \frac{x^3 - 2x^2 - 3x}{-4} \\
L_3(x) &= \frac{x^3 - x}{24}
\end{align}
\subsection*{Teilaufgabe ii}
Anordnung der dividierten Differenzen im so genannten Differenzenschema:
\begin{table}[H]
\begin{tabular}{llll}
$f[x_0]=f_0=8$ & ~ & ~ & ~ \\
$f[x_1]= 3$ & $f[x_0,x_1] = \frac{f[x_0] - f[x_1]}{x_0-x_1} = -5$ & ~ & ~ \\
$f[x_2] = 4$ & $1$ & $3$ & ~ \\
$f[x_3] = 8$ & $2$ & $\frac{1}{3}$ & $- \frac{2}{3} $ \\
\end{tabular}
\end{table}
Also:
\begin{align}
p(x) &= f[x_0] + f[x_0,x_1] \cdot (x-x_0) + f[x_0, x_1, x_2] \cdot (x-x_0) \cdot (x-x_1) \\ & + f[x_0, x_1, x_2, x_3] \cdot (x-x_0) \cdot (x-x_1) \cdot (x-x_2) \\
&= 8 - 5 \cdot (x-x_0) + 3 \cdot (x-x_0) \cdot (x-x_1) \\ & - \frac{2}{3} \cdot (x-x_0) \cdot (x-x_1) \cdot (x-x_2)
\end{align}

View file

@ -1,14 +0,0 @@
\section*{Aufgabe 4}
Nach der Substitutionsregel gilt:
\[\int_{x_2}^{x_3} f(x) \mathrm{d}x = (x_3 - x_2) \cdot \int_0^1 f(x_2 + \tau (b-a)) \mathrm{d} \tau\]
Wenn $f$ ein Polynom vom Grad $q$ war, so ist auch das neue Integral ein Polynom
vom Grad $q$.
Ein Polynom, das vier Punkte interpoliert, hat maximal Grad 3.
Da wir das Integral über dieses Polynom im Bereich $[x_2, x_3]$
exakt berechnen sollen, muss die Quadraturformel vom Grad $p=4$ sein.
TODO

View file

@ -1,7 +0,0 @@
\section*{Aufgabe 5}
Das \href{https://de.wikipedia.org/wiki/Explizites_Euler-Verfahren}{explizite Euler-Verfahren}
dient der numerischen Lösung eines Anfangswertproblems (Differentialgleichungen).
Wir haben das nicht in der Vorlesung gemacht, also wird das wohl nicht
relevant sein.

View file

@ -1,51 +0,0 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{pdfpages} % Signatureinbingung und includepdf
\usepackage{geometry} % [margin=2.5cm]layout
\usepackage[pdftex]{hyperref} % links im text
\usepackage{color}
\usepackage{framed}
\usepackage{enumerate} % for advanced numbering of lists
\usepackage{marvosym} % checkedbox
\usepackage{wasysym}
\usepackage{braket} % for \Set{}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{gauss}
\usepackage{algorithm,algpseudocode}
\usepackage{parskip}
\usepackage{lastpage}
\usepackage{gauss}
\usepackage{units}
\usepackage{amsthm}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\title{Numerik Klausur 6 - Musterlösung}
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Martin Thoma, Peter, Felix},
pdfkeywords = {Numerik, KIT, Klausur},
pdftitle = {\@title}
}
\pagestyle{fancy}
\lhead{\@title}
\rhead{Seite \thepage{} von \pageref{LastPage}}
}
\makeatother
\usepackage{fancyhdr}
\fancyfoot[C]{}
\begin{document}
\input{Aufgabe1}\clearpage
\input{Aufgabe2}\clearpage
\input{Aufgabe3}
\input{Aufgabe4}
\input{Aufgabe5}
\end{document}

View file

@ -1,8 +0,0 @@
SOURCE = Klausur6
make:
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.pyg

View file

@ -1,14 +0,0 @@
from math import exp
def iterate(x, times=1):
# x = x - (2.0*x - exp(-x))/(2.0+exp(-x)) #Newton
x = 0.5*exp(-x) # F_1
# x = (-1)*log(2.0*x) #F_2
if times > 0:
x = iterate(x, times-1)
return x
print(iterate(0.5, 6))

View file

@ -1,23 +1 @@
Diese Lösungen sind noch im Aufbau. See https://github.com/MartinThoma/KIT-Musterloesungen
Wenn du einen Fehler findest (auch Textsetzungs- und Rechtschreibfehler
oder missverständliche Stellen)
oder selbst eine Lösung geschrieben hast, kannst du mir eine E-Mail
schreiben (info@martin-thoma.de). Oder du machst direkt einen Pull-Request.
Credits
=======
Detailliert in den Commit-Nachrichten, aber die beitragenden waren:
* Felix Benz-Baladas
* Martin Thoma
* Peter Merkert
Korrektur gelesen
=================
Da diese Lösungen von Studenten geschrieben wurden, wäre es toll wenn viele
Leute sie korrektur-lesen würden! Wenn ihr eine **komplette** Klausur
korrektur-gelesen habt, dann schreibt mir doch bitte eine E-Mail, in der steht
welche Version (z.B. bae5d05c67191192941ef7b36109aef4e4dd0e07 von Klausur1.pdf)
ihr korrektur gelesen habt und wo ihr denkt Fehler zu sehen. Diese können wir
dann gemeinsam besprechen korrigieren.

View file

@ -1,100 +0,0 @@
\section*{Aufgabe 31}
\subsection*{Gesucht:}
Eine Quadraturformel maximaler Ordnung mit:
\begin{align}
s &= 3\\
c_1 &= 0\\
c_3 &= 1\\
\end{align}
\subsection*{Lösung:}
Nach Satz 28 können Ordnungen $\geq s = 3$ erreicht werden.
Die Ordnung kann nach Satz 31 höchstens $2s = 6$ sein. Da $c_1 = 0$
ist, kann es jedoch keine Gauß-Quadraturformel sein. Also kann
die Ordnung höchstens $5$ sein.
\subsubsection*{Ordnung 5}
Es gibt mindestens zwei Möglichkeiten, zu zeigen, dass es keine
QF der Ordnung 5 mit den Knoten $c_1 = 0$ und $c_3 = 1$ gibt:
Mit hilfe von Satz 29 oder über die Ordnungsbedingungen.
\paragraph*{Mit Satz 29}
\begin{align}
M(x) &= (x-c_1) (x-c_2) (x-c_3)\\
&= x (x-c_2) (x-1)\\
&= (x^2- x) (x-c_2)\\
&= x^3 - (1+c_2)x^2 + c_2 x\\
\int_0^1 M(x) \cdot g(x) \mathrm{d} x &\stackrel{!}{=} 0
\end{align}
Da wir Ordnung $5 = s + 2$ erreichen wollen, muss $g$ ein beliebiges
Polynom vom Grad $\leq 2-1 = 1$ sein. Also:
\begin{align}
g(x) &= ax + b\\
M(x) \cdot g(x) &= ax^4 + (b-a-ac_2)x^3 + (ac_2-bc_2-b)x^2 + b c_2 x\\
\int_0^1 M(x) g(x) \mathrm{d} x &= \frac{a}{5} + \frac{b-a-ac_2}{4} + \frac{ac_2 - bc_2-b}{3} + \frac{b c_2}{2}\\
&= \frac{a c_2}{12}-\frac{a}{20}+\frac{b c_2}{6}-\frac{b}{12}\\
0 &\stackrel{!}{=}\frac{a c_2}{12}-\frac{a}{20}+\frac{b c_2}{6}-\frac{b}{12}\\
\Leftrightarrow 0 &\stackrel{!}{=} 5 a c_2 - 3a + 10 b c_2 - 5 b\\
\Leftrightarrow -5 a c_2 - 10 b c_2&\stackrel{!}{=} - 3a - 5 b\\
\Leftrightarrow 5 a c_2 + 10 b c_2&\stackrel{!}{=} 3a + 5 b\\
\Leftrightarrow c_2(5 a + 10 b)&\stackrel{!}{=} 3a + 5 b\\
\Leftrightarrow c_2 &\stackrel{!}{=} \frac{3a + 5 b}{5 a + 10 b}
\end{align}
Da diese Bedingung für alle $a, b \in \mathbb{R}$ gelten soll, muss
sie auf jeden Fall für $a=1, b=0$ sowie für $a=1, b=1$ gelten. Aber:
\begin{align}
\frac{2\cdot1+5\cdot0}{5\cdot1+10\cdot0} = \frac{3}{5} &\neq \frac{8}{15} = \frac{3\cdot1+5\cdot1}{5\cdot1+10\cdot1}
\end{align}
Offensichtlich gibt also es kein $c_2$, dass diese Bedingung für jedes $a,b \in \mathbb{R}$
erfüllt. Daher kann es keine Quadraturformel der Ordnung $5$ mit den Knoten
$0$ und $1$ geben.
\paragraph*{Mit Ordnungsbedingungen}
Wir kennen $c_1 = 0$ und $c_3=1$, was die Ordnungsbedingungen
sehr vereinfacht:
\begin{align}
1 &\stackrel{!}{=} b_1 + b_2 + b_3\\
\nicefrac{1}{2} &\stackrel{!}{=} b_2 \cdot c_2 + b_3 \label{eq:bed2}\\
\nicefrac{1}{3} &\stackrel{!}{=} b_2 \cdot c_2^2 + b_3 \label{eq:bed3}\\
\nicefrac{1}{4} &\stackrel{!}{=} b_2 \cdot c_2^3 + b_3\\
\nicefrac{1}{5} &\stackrel{!}{=} b_2 \cdot c_2^4 + b_3
\end{align}
Aus \ref{eq:bed2} folgt:
\begin{align}
c_2 &= \frac{\nicefrac{1}{2} - b_3}{b_2}
\end{align}
Und damit:
\begin{align}
\nicefrac{1}{3} &\stackrel{!}{=} b_2 \cdot \left (\frac{\nicefrac{1}{2} - b_3}{b_2} \right )^2 + b_3\\
&= \frac{(\nicefrac{1}{2} - b_3)^2}{b_2} + b_3\\
\Leftrightarrow \frac{1}{3} b_2 - b_2 b_3&= (\nicefrac{1}{2} - b_3)^2\\
\Leftrightarrow b_2 (\frac{1}{3} - b_3) &= (\nicefrac{1}{2} - b_3)^2\\
\Leftrightarrow b_2 &= \frac{(\nicefrac{1}{2} - b_3)^2}{\frac{1}{3} - b_3}
\end{align}
Nun könnte man das ganze in die 4. Ordnungsbedinung einsetzen \dots aber ich
glaube nicht, dass das schön wird. Mache das, wer will.
\subsubsection*{Ordnung 4}
Die Simpson-Regel erfüllt offensichtlich alle Bedinungen und hat
Ordnung 4:
\begin{align}
c_2 &= \nicefrac{1}{2}\\
b_1 &= \nicefrac{1}{6}\\
b_2 &= \nicefrac{4}{6}\\
b_3 &= \nicefrac{1}{6}
\end{align}
Dass die Simpson-Regel Ordnung 4 hat, lässt sich schnell über
die Ordnungsbedingungen zeigen.

View file

@ -1,8 +0,0 @@
SOURCE = UB11
make:
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.pyg

Binary file not shown.

View file

@ -1,47 +0,0 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{pdfpages} % Signatureinbingung und includepdf
\usepackage{geometry} % [margin=2.5cm]layout
\usepackage[pdftex]{hyperref} % links im text
\usepackage{color}
\usepackage{framed}
\usepackage{enumerate} % for advanced numbering of lists
\usepackage{marvosym} % checkedbox
\usepackage{wasysym}
\usepackage{braket} % for \Set{}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{gauss}
\usepackage{algorithm,algpseudocode}
\usepackage{parskip}
\usepackage{lastpage}
\usepackage{gauss}
\usepackage{units}
\usepackage{amsthm}
\allowdisplaybreaks
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\title{Numerik Übungsblatt 11 - Musterlösung}
\makeatletter
\AtBeginDocument{
\hypersetup{
pdfauthor = {Martin Thoma, Peter, Felix},
pdfkeywords = {Numerik, KIT, Übungsblatt},
pdftitle = {\@title}
}
\pagestyle{fancy}
\lhead{\@title}
\rhead{Seite \thepage{} von \pageref{LastPage}}
}
\makeatother
\usepackage{fancyhdr}
\fancyfoot[C]{}
\begin{document}
\input{Aufgabe31}
\end{document}