From 38bf01cfbcb836fc0f95a1349bd1756c1bc789af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Wed, 8 Dec 2021 20:22:01 +0100 Subject: complete diff problems --- buch/chapters/050-differential/Makefile.inc | 3 +++ buch/chapters/050-differential/chapter.tex | 1 + .../050-differential/uebungsaufgaben/503.tex | 7 +++++-- .../050-differential/uebungsaufgaben/airy.cpp | 8 ++------ .../050-differential/uebungsaufgaben/airy.pdf | Bin 18892 -> 18891 bytes .../050-differential/uebungsaufgaben/airy.tex | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) (limited to 'buch/chapters/050-differential') diff --git a/buch/chapters/050-differential/Makefile.inc b/buch/chapters/050-differential/Makefile.inc index 42ea252..5e44d69 100644 --- a/buch/chapters/050-differential/Makefile.inc +++ b/buch/chapters/050-differential/Makefile.inc @@ -9,4 +9,7 @@ CHAPTERFILES = $(CHAPTERFILES) \ chapters/050-differential/potenzreihenmethode.tex \ chapters/050-differential/bessel.tex \ chapters/050-differential/hypergeometrisch.tex \ + chapters/050-differential/uebungsaufgaben/501.tex \ + chapters/050-differential/uebungsaufgaben/502.tex \ + chapters/050-differential/uebungsaufgaben/503.tex \ chapters/050-differential/chapter.tex diff --git a/buch/chapters/050-differential/chapter.tex b/buch/chapters/050-differential/chapter.tex index 08bf6c6..a3ffbfe 100644 --- a/buch/chapters/050-differential/chapter.tex +++ b/buch/chapters/050-differential/chapter.tex @@ -71,5 +71,6 @@ die Bessel-Funktionen erster Art vorgestellt. %\uebungsaufgabe{0} \uebungsaufgabe{501} \uebungsaufgabe{502} +\uebungsaufgabe{503} \end{uebungsaufgaben} diff --git a/buch/chapters/050-differential/uebungsaufgaben/503.tex b/buch/chapters/050-differential/uebungsaufgaben/503.tex index 7cb47de..26dafe7 100644 --- a/buch/chapters/050-differential/uebungsaufgaben/503.tex +++ b/buch/chapters/050-differential/uebungsaufgaben/503.tex @@ -1,19 +1,22 @@ -Verwenden Sie die Funktion \texttt{gsl_sf_hyperg_0F1} oder ein Programm, +Verwenden Sie die Funktion \verb+gsl_sf_hyperg_0F1+ oder ein Programm, welches die Reihenentwicklung der hypergeometrischen Funktion $\mathstrut_0F_1$ direkt berechnet, um die in Aufgabe \ref{501} gefundenen Lösungen der Airy-Differentialgleichung zu plotten. -\begin{loesung} \begin{figure} \centering \includegraphics{chapters/050-differential/uebungsaufgaben/airy.pdf} \caption{Plot der Lösungen der Airy-Differentialgleichung $y''-xy=0$ zu den Anfangsbedingungen $y(0)=1$ und $y'(0)=0$ in {\color{red}rot} und $y(0)=0$ und $y'(0)=1$ in {\color{blue}blau}. +\label{buch:differentialgleichunge:uebung:503:plot}} \end{figure} +\begin{loesung} Die Implementation der hypergeometrische Funktion $\mathstrut_0F_1$ in der GNU Scientific Library führt $\mathstrut_0F_1$ auf Bessel-Funktionen zurück, was für $c=\frac23$ nicht möglich ist. In diesem Fall ist also eine eigene Implementation nötig. +Die Plots sind in Abbildung~\ref{buch:differentialgleichunge:uebung:503:plot} +dargestellt. \end{loesung} diff --git a/buch/chapters/050-differential/uebungsaufgaben/airy.cpp b/buch/chapters/050-differential/uebungsaufgaben/airy.cpp index 20cad38..bbd5166 100644 --- a/buch/chapters/050-differential/uebungsaufgaben/airy.cpp +++ b/buch/chapters/050-differential/uebungsaufgaben/airy.cpp @@ -34,8 +34,6 @@ double h0f1(double c, double x) { k++; term *= x / ((c+k-1) * k); s += term; - // if (debug) - // fprintf(stderr, "term = %.14f\n", term); counter++; } if (debug) @@ -43,11 +41,9 @@ double h0f1(double c, double x) { return s; } -double f0(double x) { - //return gsl_sf_hyperg_0F1(2/3, x*x*x/9.); - return h0f1(2./3., x*x*x/9.); -} double f1(double x) { + // unfortunately, gsl_sf_hyperg_0F1 does not work if c<1, because + // it uses a relation to the bessel functions //return gsl_sf_hyperg_0F1(2/3, x*x*x/9.); return h0f1(2./3., x*x*x/9.); } diff --git a/buch/chapters/050-differential/uebungsaufgaben/airy.pdf b/buch/chapters/050-differential/uebungsaufgaben/airy.pdf index f52e601..6712fa0 100644 Binary files a/buch/chapters/050-differential/uebungsaufgaben/airy.pdf and b/buch/chapters/050-differential/uebungsaufgaben/airy.pdf differ diff --git a/buch/chapters/050-differential/uebungsaufgaben/airy.tex b/buch/chapters/050-differential/uebungsaufgaben/airy.tex index 27ee546..29ad388 100644 --- a/buch/chapters/050-differential/uebungsaufgaben/airy.tex +++ b/buch/chapters/050-differential/uebungsaufgaben/airy.tex @@ -28,7 +28,7 @@ \end{scope} \draw[->] (-8.1,0) -- (2.9,0) coordinate[label={$x$}]; -\draw[->] (0,-1.4) -- (0,4.4) coordinate[label={$y$}]; +\draw[->] (0,-1.4) -- (0,4.4) coordinate[label={right:$y$}]; \foreach \x in {-8,...,-1}{ \draw ({\x*\dx},-0.1) -- ({\x*\dx},0.1); -- cgit v1.2.1