aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/090-pde/bessel
diff options
context:
space:
mode:
Diffstat (limited to 'buch/chapters/090-pde/bessel')
-rw-r--r--buch/chapters/090-pde/bessel/Makefile15
-rw-r--r--buch/chapters/090-pde/bessel/besselnodes.m106
-rw-r--r--buch/chapters/090-pde/bessel/besselzeros.m70
-rw-r--r--buch/chapters/090-pde/bessel/besselzeros.tex17
-rw-r--r--buch/chapters/090-pde/bessel/pauke.pdfbin0 -> 24066 bytes
-rw-r--r--buch/chapters/090-pde/bessel/pauke.tex21
6 files changed, 229 insertions, 0 deletions
diff --git a/buch/chapters/090-pde/bessel/Makefile b/buch/chapters/090-pde/bessel/Makefile
new file mode 100644
index 0000000..c189517
--- /dev/null
+++ b/buch/chapters/090-pde/bessel/Makefile
@@ -0,0 +1,15 @@
+#
+# Makefile
+#
+# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+#
+all: besselzeros.tex besselnodes.tex pauke.pdf
+
+besselzeros.tex: besselzeros.m
+ octave besselzeros.m
+
+besselnodes.tex: besselnodes.m
+ octave besselnodes.m
+
+pauke.pdf: pauke.tex besselnodes.tex
+ pdflatex pauke.tex
diff --git a/buch/chapters/090-pde/bessel/besselnodes.m b/buch/chapters/090-pde/bessel/besselnodes.m
new file mode 100644
index 0000000..0dcba3e
--- /dev/null
+++ b/buch/chapters/090-pde/bessel/besselnodes.m
@@ -0,0 +1,106 @@
+#
+# besselnodes.m
+#
+# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+#
+global maxmu;
+maxmu = 3;
+global maxk;
+maxk = 4;
+global mu;
+
+nachkommastellen = 4;
+
+function retval = f(x)
+ global mu;
+ retval = besselj(mu, x);
+endfunction
+
+global kzeros;
+kzeros = zeros(maxk+1, maxmu+1);
+for mu = (0:maxmu)
+ k = 0;
+ x = 0.0001;
+ while (k <= maxk)
+ bracket = [ x, x+1 ];
+ if (f(bracket(1)) * f(bracket(2)) < 0)
+ kzeros(k+1,mu+1) = fzero("f", bracket);
+ k = k + 1;
+ endif
+ x = x + 1;
+ endwhile
+endfor
+
+xshift = 4;
+yshift = 4;
+global r;
+r = 1.8;
+
+function retval = anderefarbe(f)
+ if (1 == strcmp("red", f))
+ retval = "blue";
+ else
+ retval = "red";
+ endif
+endfunction
+
+function sektor(fn, mu, k, w0, w1, startfarbe)
+ global kzeros;
+ global r;
+ fprintf(fn, "\\begin{scope}\n");
+ fprintf(fn, "\\clip (0,0)--(%.4f:%.4f) arc (%.4f:%.4f:%.4f)--cycle;\n",
+ w0, r, w0, w1, r);
+ faktor = kzeros(k+1,mu+1);
+
+ K = k + 1;
+ farbe = startfarbe;
+ while (K > 0)
+ R = r * kzeros(K, mu+1) / faktor;
+ fprintf(fn, "\\fill[color=%s!20] ", farbe);
+ fprintf(fn, "(0,0) circle[radius=%.4f];\n", R);
+ farbe = anderefarbe(farbe);
+ K = K-1;
+ end
+ fprintf(fn, "\\end{scope}\n");
+endfunction
+
+fn = fopen("besselnodes.tex", "w");
+
+#fprintf(fn, "\\begin{tikzpicture}[>=latex,thick]\n");
+
+for mu = (0:maxmu)
+ if (mu > 0)
+ winkel = 180 / mu;
+ else
+ winkel = 360;
+ endif
+ for k = (0:maxk)
+ fprintf(fn, "\\begin{scope}[xshift=%.3fcm,yshift=-%.3fcm]\n",
+ mu * xshift, k * yshift);
+ for w0 = (0:2*winkel:360)
+ sektor(fn, mu, k, w0, w0 + winkel, "red");
+ if (winkel < 270)
+ sektor(fn, mu, k, w0 + winkel, w0 + 2 * winkel, "blue");
+ endif
+ endfor
+
+ fprintf(fn, "\\draw (0,0) circle[radius=%.4f];\n", r);
+
+ fprintf(fn, "\\end{scope}\n\n");
+ endfor
+endfor
+
+for mu = (0:maxmu)
+ fprintf(fn, "\\node at (%.4f,%.4f) [above] {$\\mu=%d$};\n",
+ mu * xshift, 0.5 * yshift, mu);
+endfor
+
+for k = (0:maxk)
+ fprintf(fn, "\\node at (%.4f,%.4f) [above,rotate=90] {$k=%d$};\n",
+ -0.5 * xshift, -k * yshift, k);
+endfor
+
+#fprintf(fn, "\\end{tikzpicture}\n");
+
+fclose(fn);
+
diff --git a/buch/chapters/090-pde/bessel/besselzeros.m b/buch/chapters/090-pde/bessel/besselzeros.m
new file mode 100644
index 0000000..9c8fa9d
--- /dev/null
+++ b/buch/chapters/090-pde/bessel/besselzeros.m
@@ -0,0 +1,70 @@
+#
+# besselzeros.m -- find zeros of bessel functions
+#
+# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+# 
+global maxmu;
+maxmu = 7;
+global maxk;
+maxk = 10;
+global mu;
+
+nachkommastellen = 4;
+
+function retval = f(x)
+ global mu;
+ retval = besselj(mu, x);
+endfunction
+
+kzeros = zeros(maxk+1, maxmu+1);
+for mu = (0:maxmu)
+ k = 0;
+ if (mu > 0)
+ kzeros(1, mu+1) = 0;
+ k = k+1;
+ endif
+ x = 0.0001;
+ while (k <= maxk)
+ bracket = [ x, x+1 ];
+ if (f(bracket(1)) * f(bracket(2)) < 0)
+ kzeros(k+1,mu+1) = fzero("f", bracket);
+ k = k + 1;
+ endif
+ x = x + 1;
+ endwhile
+endfor
+
+# kzeros
+
+fn = fopen("besselzeros.tex", "w");
+
+fprintf(fn, "\\begin{tabular}{|>{$}c<{$}");
+for mu = (0:maxmu)
+ fprintf(fn, "|>{$}r<{$}");
+endfor
+fprintf(fn, "|}\n");
+
+fprintf(fn, "\\hline\n");
+fprintf(fn, " k ");
+for mu = (0:maxmu)
+ fprintf(fn, "& \\mu = %d ", mu);
+endfor
+fprintf(fn, "\\\\\n");
+fprintf(fn, "\\hline\n");
+
+for k = (0:maxk)
+ fprintf(fn, " %d ", k);
+ for mu = (0:maxmu)
+ value = kzeros(k+1, mu+1);
+ if (value == 0)
+ fprintf(fn, "& 0\\phantom{.%0*d}", nachkommastellen, 0);
+ else
+ fprintf(fn, "& %*.*f", nachkommastellen+4, nachkommastellen, kzeros(k+1, mu+1));
+ endif
+ endfor
+ fprintf(fn, "\\\\\n");
+endfor
+fprintf(fn, "\\hline\n");
+fprintf(fn, "\\end{tabular}\n");
+
+fclose(fn);
diff --git a/buch/chapters/090-pde/bessel/besselzeros.tex b/buch/chapters/090-pde/bessel/besselzeros.tex
new file mode 100644
index 0000000..1b8d33b
--- /dev/null
+++ b/buch/chapters/090-pde/bessel/besselzeros.tex
@@ -0,0 +1,17 @@
+\begin{tabular}{|>{$}c<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|>{$}r<{$}|}
+\hline
+ k & \mu = 0 & \mu = 1 & \mu = 2 & \mu = 3 & \mu = 4 & \mu = 5 & \mu = 6 & \mu = 7 \\
+\hline
+ 0 & 2.4048& 0\phantom{.0000}& 0\phantom{.0000}& 0\phantom{.0000}& 0\phantom{.0000}& 0\phantom{.0000}& 0\phantom{.0000}& 0\phantom{.0000}\\
+ 1 & 5.5201& 3.8317& 5.1356& 6.3802& 7.5883& 8.7715& 9.9361& 11.0864\\
+ 2 & 8.6537& 7.0156& 8.4172& 9.7610& 11.0647& 12.3386& 13.5893& 14.8213\\
+ 3 & 11.7915& 10.1735& 11.6198& 13.0152& 14.3725& 15.7002& 17.0038& 18.2876\\
+ 4 & 14.9309& 13.3237& 14.7960& 16.2235& 17.6160& 18.9801& 20.3208& 21.6415\\
+ 5 & 18.0711& 16.4706& 17.9598& 19.4094& 20.8269& 22.2178& 23.5861& 24.9349\\
+ 6 & 21.2116& 19.6159& 21.1170& 22.5827& 24.0190& 25.4303& 26.8202& 28.1912\\
+ 7 & 24.3525& 22.7601& 24.2701& 25.7482& 27.1991& 28.6266& 30.0337& 31.4228\\
+ 8 & 27.4935& 25.9037& 27.4206& 28.9084& 30.3710& 31.8117& 33.2330& 34.6371\\
+ 9 & 30.6346& 29.0468& 30.5692& 32.0649& 33.5371& 34.9888& 36.4220& 37.8387\\
+ 10 & 33.7758& 32.1897& 33.7165& 35.2187& 36.6990& 38.1599& 39.6032& 41.0308\\
+\hline
+\end{tabular}
diff --git a/buch/chapters/090-pde/bessel/pauke.pdf b/buch/chapters/090-pde/bessel/pauke.pdf
new file mode 100644
index 0000000..54edc20
--- /dev/null
+++ b/buch/chapters/090-pde/bessel/pauke.pdf
Binary files differ
diff --git a/buch/chapters/090-pde/bessel/pauke.tex b/buch/chapters/090-pde/bessel/pauke.tex
new file mode 100644
index 0000000..bba092e
--- /dev/null
+++ b/buch/chapters/090-pde/bessel/pauke.tex
@@ -0,0 +1,21 @@
+%
+% pauke.tex -- template for standalon tikz images
+%
+% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+%
+\documentclass[tikz]{standalone}
+\usepackage{amsmath}
+\usepackage{times}
+\usepackage{txfonts}
+\usepackage{pgfplots}
+\usepackage{csvsimple}
+\usetikzlibrary{arrows,intersections,math}
+\begin{document}
+\def\skala{1}
+\begin{tikzpicture}[>=latex,thick,scale=\skala]
+
+\input{besselnodes.tex}
+
+\end{tikzpicture}
+\end{document}
+