diff options
Diffstat (limited to '')
-rw-r--r-- | buch/chapters/40-eigenwerte/images/Makefile | 13 | ||||
-rw-r--r-- | buch/chapters/40-eigenwerte/images/sp.pdf | bin | 0 -> 24049 bytes | |||
-rw-r--r-- | buch/chapters/40-eigenwerte/images/sp.tex | 62 | ||||
-rw-r--r-- | buch/chapters/40-eigenwerte/images/spbeispiel.m | 51 |
4 files changed, 126 insertions, 0 deletions
diff --git a/buch/chapters/40-eigenwerte/images/Makefile b/buch/chapters/40-eigenwerte/images/Makefile new file mode 100644 index 0000000..5915d30 --- /dev/null +++ b/buch/chapters/40-eigenwerte/images/Makefile @@ -0,0 +1,13 @@ +# +# Makefile +# +# (c) 2020 Prof Dr Andreas Müller, Hochschule Rappersil +# +all: sp.pdf + +sp.pdf: sp.tex sppaths.tex + pdflatex sp.tex + +sppaths.tex: spbeispiel.m + octave spbeispiel.m + diff --git a/buch/chapters/40-eigenwerte/images/sp.pdf b/buch/chapters/40-eigenwerte/images/sp.pdf Binary files differnew file mode 100644 index 0000000..5346e06 --- /dev/null +++ b/buch/chapters/40-eigenwerte/images/sp.pdf diff --git a/buch/chapters/40-eigenwerte/images/sp.tex b/buch/chapters/40-eigenwerte/images/sp.tex new file mode 100644 index 0000000..db70889 --- /dev/null +++ b/buch/chapters/40-eigenwerte/images/sp.tex @@ -0,0 +1,62 @@ +% +% sp.tex -- template for standalon tikz images +% +% (c) 2020 Prof Dr Andreas Müller, Hochschule Rapperswil +% +\documentclass[tikz]{standalone} +\usepackage{amsmath} +\usepackage{times} +\usepackage{txfonts} +\usepackage{pgfplots} +\usepackage{csvsimple} +\usetikzlibrary{arrows,intersections,math} +\begin{document} +\def\skala{2.33} +\input{sppaths.tex} +\begin{tikzpicture}[>=latex,thick,scale=\skala] + +\xdef\sx{1} +\xdef\sy{1} + +% add image content here +\begin{scope} +\begin{scope} +\clip (0,0) rectangle (3,2.1); +\richardson +\end{scope} +\draw[->] (-0.1,0) -- (3.15,0) coordinate[label={$\tau$}]; +\draw[->] (0,-0.1) -- (0,2.3) coordinate[label={right:$\varrho(\frac1\tau A-E)$}]; +\draw (1,{-0.1/\skala}) -- (1,{0.1/\skala}); +\draw (2,{-0.1/\skala}) -- (2,{0.1/\skala}); +\draw (3,{-0.1/\skala}) -- (3,{0.1/\skala}); +\node at (1,{-0.1/\skala}) [below] {1}; +\node at (2,{-0.1/\skala}) [below] {2}; +\node at (3,{-0.1/\skala}) [below] {3}; +\draw ({-0.1/\skala},1) -- ({0.1/\skala},1); +\draw ({-0.1/\skala},2) -- ({0.1/\skala},2); +\node at ({-0.1/\skala},1) [left] {1}; +\node at ({-0.1/\skala},2) [left] {2}; +\end{scope} + +\xdef\sy{1} + +\begin{scope}[xshift=3.5cm] +\begin{scope} +\clip (0,0) rectangle (2,2); +\sor +\end{scope} +\draw[->] (-0.1,0) -- (2.15,0) coordinate[label={$\omega$}]; +\draw[->] (0,-0.1) -- (0,2.3) coordinate[label={right:$\varrho(B_\omega^{-1}C_\omega)$}]; +\draw (1,{-0.1/\skala}) -- (1,{0.1/\skala}); +\draw (2,{-0.1/\skala}) -- (2,{0.1/\skala}); +\node at (1,{-0.1/\skala}) [below] {1}; +\node at (2,{-0.1/\skala}) [below] {2}; +\draw ({-0.1/\skala},1) -- ({0.1/\skala},1); +\draw ({-0.1/\skala},2) -- ({0.1/\skala},2); +\node at ({-0.1/\skala},1) [left] {1}; +\node at ({-0.1/\skala},2) [left] {2}; +\end{scope} + +\end{tikzpicture} +\end{document} + diff --git a/buch/chapters/40-eigenwerte/images/spbeispiel.m b/buch/chapters/40-eigenwerte/images/spbeispiel.m new file mode 100644 index 0000000..81160b9 --- /dev/null +++ b/buch/chapters/40-eigenwerte/images/spbeispiel.m @@ -0,0 +1,51 @@ +# +# spbeispiel.m +# +# (c) 2020 Prof Dr Andreas Müller, Hochschule Rapperswil +# +N = 30 +R = 0.05 * rand(N,N); +R = R + R'; +A = eye(N) + R; +L = tril(A,-1) +U = tril(A',-1)' +D = diag(diag(A)) + +A + +function r = spektralradius(A) + r = max(abs(eig(A))); +end + +gaussseidel = spektralradius(inverse(L+D)*U) +jacobi = spektralradius(inverse(D)*(L+U)) +richardson = spektralradius(A - eye(N)) + +fd = fopen("sppaths.tex", "w"); + +fprintf(fd, "\\def\\richardson{\n") +tau = 0.1; +r = spektralradius((1/tau) * A - eye(N)) +fprintf(fd, "\\draw[line width=1.4pt,color=red] ({\\sx*0.1},{\\sy*%.5f})", r); +for tau = (11:300) / 100 + r = spektralradius((1/tau) * A - eye(N)); + fprintf(fd, "\n--({\\sx*%.5f},{\\sy*%.5f})", tau, r); +end +fprintf(fd, "\n;}\n"); + +fprintf(fd, "\\def\\sor{\n"); +omega = 1/100 +B = (1/omega) * D + L; +C = (1-1/omega) * D + U; +r = spektralradius(inverse(B) * C) +fprintf(fd, "\\draw[line width=1.4pt,color=red] ({\\sx*%.3f},{\\sy*%.3f})", omega, r); +for omega = (2:200) / 100 + B = (1/omega) * D + L; + C = (1-1/omega) * D + U; + r = spektralradius(inverse(B) * C); + fprintf(fd, "\n--({\\sx*%.5f},{\\sy*%.5f})", omega, r); +end +fprintf(fd, ";\n}\n"); + +fclose(fd); + |