4. Übung
Bearbeitung vom 15.11.06 - 20.11.06
Aufgabe 1: Numerische Differentiationen
Wir schreiben die Taylerentwicklung um den Punkt $x$ bis zur Ordnung $h^{2}$:

\begin{displaymath}
f(x \pm h) = f(x) \pm h f'(x) + \frac{h^{2}}{2} f''(x) + O(h^{3})
\end{displaymath}

Hieraus folgt:

\begin{displaymath}
f(x+h) - f(x-h) \approx 2 h f'(x) \; \; \; \; \; \rightarrow \; \; \; \; \; f'(x) \approx \frac{f(x+h)-f(x-h)}{2h}
\end{displaymath}

Dieses ist die 3- Point Approximation. Wir gehen einen Schritt weiter und schreiben die Taylorentwicklungen für die Punkte $x \pm h$ sowie $x \pm 2h$ bis zur Ordung $h^{3}$:
$\displaystyle f(x \pm h)$ $\textstyle =$ $\displaystyle f(x) \pm h f'(x) + \frac{h^{2}}{2} f''(x) \pm \frac{h^{3}}{6} f'''(x) + O_{1}(h^{4})$ (1)
$\displaystyle f(x \pm 2 h)$ $\textstyle =$ $\displaystyle f(x) \pm 2 h f'(x) + 2 h^{2} f''(x) \pm \frac{4 h^{3}}{3} f'''(x) + O_{2}(h^{4})$ (2)

Daraus berechnen wir (bitte zu Hause nachrechnen!):

\begin{displaymath}
f(x-2h) - 8 f(x-h) + 8 f(x+h) - f(x + 2h) \approx 12 h f'(x)
\end{displaymath}


\begin{displaymath}
f'(x) \approx \frac{1}{12 h} [ f(x-2h) - 8 f(x-h) + 8 f(x+h) - f(x+2h)]
\end{displaymath}

Dieses nennt man die 5-Point Approximation.
a) Ersetzen Sie im Programm newton_cos.cc die analytische Berechnung der Ableitung durch ein numerisches Verfahren mit der 5-Point Approximation.
b) Die Hyperbelfunktionen sind definiert als
$\displaystyle sinh(x)$ $\textstyle =$ $\displaystyle \frac{1}{2} \left( e^{x} - e^{-x} \right)$  
$\displaystyle cosh(x)$ $\textstyle =$ $\displaystyle \frac{1}{2} \left( e^{x} + e^{-x} \right)$  
$\displaystyle tanh(x)$ $\textstyle =$ $\displaystyle \frac{sinh(x)}{cosh(x)}$  

Der $tanh(x)$ hat eine Nullstelle bei $x=0$. Die Ableitung ist $1/cosh^{2}(x)$. Sie können die Funktion graphisch in unserem Funktionsplotter visualisieren. Für welche Bereiche des Startwertes $x_{0}$ konvergiert das Newton- Verfahren nicht ?
Aufgabe 2: Fourieranalyse
Verändern Sie das Programm test_hebbeker1.cc so, daß es eine Fourierzerlegung der in hebbeker1.o programmierten Funktion durchführt, und zwar mit $n=10$ Fourieramplituden und $N=100$ Funktionswerten. Linken Sie dazu die Object- Datei zusammen mit test_hebbeker1.cc zu einer ausführbaren Datei.
Aufgabe 3: Differentialgleichungen (Zusatzaufgabe für die Oberschlauen)
Mit Hilfe der Ausdrücke (1) und (2) kann man ebenso eine numerische Formel für die zweite Ableitung herleiten:

\begin{displaymath}
f''(x) \approx \frac{1}{12 h^{2}} [ - f(x-2h) + 16 f(x-h) - 30 f(x) + 16 f(x+h) - f(x+2h)]
\end{displaymath}

Die Funktion

\begin{displaymath}
f(x) = e^{-0.5 x} cos(\sqrt{0.75}\; x)
\end{displaymath}

erfüllt mathematisch exakt die Gleichung

\begin{displaymath}
f''(x) + f'(x) + f(x) = 0
\end{displaymath}

Wenn man für die Ableitungen die numerischen 5- Punkt Approximationen einzetzt, erhält man

\begin{displaymath}
f_{5pt}''(x) + f_{5pt}'(x) + f(x) = \epsilon \approx 0
\end{displaymath}

Untersuchen Sie, wie $\epsilon$ vom Parameter $h$ in der Taylor- Entwicklung abhängt.



Harm Fesefeldt
2006-11-14