From 812a80acf52275699afb285db46aa76be03006c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Mon, 18 Jan 2021 21:01:26 +0100 Subject: add more stuff about spectral radius --- buch/chapters/40-eigenwerte/images/Makefile | 13 +++++ buch/chapters/40-eigenwerte/images/sp.pdf | Bin 0 -> 24049 bytes buch/chapters/40-eigenwerte/images/sp.tex | 62 ++++++++++++++++++++++++ buch/chapters/40-eigenwerte/images/spbeispiel.m | 51 +++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 buch/chapters/40-eigenwerte/images/Makefile create mode 100644 buch/chapters/40-eigenwerte/images/sp.pdf create mode 100644 buch/chapters/40-eigenwerte/images/sp.tex create mode 100644 buch/chapters/40-eigenwerte/images/spbeispiel.m (limited to 'buch/chapters/40-eigenwerte/images') 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 new file mode 100644 index 0000000..5346e06 Binary files /dev/null and b/buch/chapters/40-eigenwerte/images/sp.pdf differ 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); + -- cgit v1.2.1 From ada53a9c225b896c8d7608300427aac475bb7045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Tue, 9 Feb 2021 21:52:16 +0100 Subject: move all iamges to separate files --- buch/chapters/40-eigenwerte/images/Makefile | 5 +- buch/chapters/40-eigenwerte/images/nilpotent.pdf | Bin 0 -> 14254 bytes buch/chapters/40-eigenwerte/images/nilpotent.tex | 76 +++++++++++++++++++++++ buch/chapters/40-eigenwerte/images/sp.pdf | Bin 24049 -> 24022 bytes 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 buch/chapters/40-eigenwerte/images/nilpotent.pdf create mode 100644 buch/chapters/40-eigenwerte/images/nilpotent.tex (limited to 'buch/chapters/40-eigenwerte/images') diff --git a/buch/chapters/40-eigenwerte/images/Makefile b/buch/chapters/40-eigenwerte/images/Makefile index 5915d30..db00dac 100644 --- a/buch/chapters/40-eigenwerte/images/Makefile +++ b/buch/chapters/40-eigenwerte/images/Makefile @@ -3,7 +3,7 @@ # # (c) 2020 Prof Dr Andreas Müller, Hochschule Rappersil # -all: sp.pdf +all: sp.pdf nilpotent.pdf sp.pdf: sp.tex sppaths.tex pdflatex sp.tex @@ -11,3 +11,6 @@ sp.pdf: sp.tex sppaths.tex sppaths.tex: spbeispiel.m octave spbeispiel.m +nilpotent.pdf: nilpotent.tex + pdflatex nilpotent.tex + diff --git a/buch/chapters/40-eigenwerte/images/nilpotent.pdf b/buch/chapters/40-eigenwerte/images/nilpotent.pdf new file mode 100644 index 0000000..2106697 Binary files /dev/null and b/buch/chapters/40-eigenwerte/images/nilpotent.pdf differ diff --git a/buch/chapters/40-eigenwerte/images/nilpotent.tex b/buch/chapters/40-eigenwerte/images/nilpotent.tex new file mode 100644 index 0000000..1e6cd79 --- /dev/null +++ b/buch/chapters/40-eigenwerte/images/nilpotent.tex @@ -0,0 +1,76 @@ +% +% nilpotent.tex -- Produkt nilpotenter Matrizen +% +% (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} +\usepackage[many]{tcolorbox} + +\begin{document} +\def\skala{1} + +\newtcbox{\myboxA}{blank,boxsep=0mm, +clip upper,minipage, +width=31.0mm,height=17.0mm,nobeforeafter, +borderline={0.0pt}{0.0pt}{white}, +} + +\begin{tikzpicture}[>=latex,thick,scale=\skala] + +\def\cx{1.8} +\def\cy{1.2} + +\draw[line width=0.3pt] (-3,2.5) -- (6,2.5); + +\begin{scope}[xshift=-4cm] +\node at (1.5,1.53) {$\left(\myboxA{}\right)$}; +\fill[color=red!30] (0.5,3) -- (3,0.5) -- (3,3) -- cycle; +\draw (0,0) rectangle (3,3); +\draw (0,3) -- (3,0); +\node at ({\cx+0.5*0.5},{\cy+0.5*0.5}) [rotate=-45] {$k$}; +\draw[color=blue,line width=1.4pt] (0,2.5) -- (1.0,2.5); +\draw[color=red,line width=1.4pt] (1.0,2.5) -- (3,2.5); +\node at (1,1) {$B$}; +\node at (-0.3,2.5) [left] {$i$}; +\node at (1,2.5) [above right] {$i+k$}; +\end{scope} + +\node at (-0.5,1.5) {$\mathstrut\cdot\mathstrut$}; + +\begin{scope} +\node at (1.5,1.53) {$\left(\myboxA{}\right)$}; +\fill[color=red!30] (1.0,3) -- (3,1.0) -- (3,3) -- cycle; +\draw (0,0) rectangle (3,3); +\draw (0,3) -- (3,0); +\node at ({\cx+1.0*0.5},{\cy+1.0*0.5}) [rotate=-45] {$l$}; +\draw[color=red,line width=1.4pt] (2,3)--(2,2); +\draw[color=blue,line width=1.4pt] (2,2)--(2,0); +\node at (1,1) {$C$}; +\node at (2,3) [above] {$j$}; +\node at (2,2) [above right] {$j-l$}; +\end{scope} + +\node at (3.5,1.5) {$\mathstrut=\mathstrut$}; + +\begin{scope}[xshift=4cm] +\node at (1.5,1.53) {$\left(\myboxA{}\right)$}; +\fill[color=red!30] (1.5,3) -- (3,1.5) -- (3,3) -- cycle; +\draw (0,0) rectangle (3,3); +\draw (0,3) -- (3,0); +\node at ({\cx+1.5*0.5},{\cy+1.5*0.5}) [rotate=-45] {$k+l$}; +\fill[color=red!50!blue] (2,2.5) circle[radius=0.1]; +\draw[line width=0.3pt] (2,3) -- (2,2.5); +\node at (2,3) [above] {$j$}; +\node at (1,1) {$D$}; +\end{scope} + +\end{tikzpicture} + +\end{document} + diff --git a/buch/chapters/40-eigenwerte/images/sp.pdf b/buch/chapters/40-eigenwerte/images/sp.pdf index 5346e06..d4de984 100644 Binary files a/buch/chapters/40-eigenwerte/images/sp.pdf and b/buch/chapters/40-eigenwerte/images/sp.pdf differ -- cgit v1.2.1