Browse Source

Latex init

master
Johannes Ziegmann 3 years ago
parent
commit
57b77dad6f
  1. 192
      01_tex/DissTeX.ahk
  2. 3101
      01_tex/Diss_JohZ.bib
  3. 12
      01_tex/Diss_JohZiegmann.acn
  4. 18
      01_tex/Diss_JohZiegmann.acr
  5. 7
      01_tex/Diss_JohZiegmann.alg
  6. 160
      01_tex/Diss_JohZiegmann.aux
  7. 1
      01_tex/Diss_JohZiegmann.auxlock
  8. 188
      01_tex/Diss_JohZiegmann.bbl
  9. 2022
      01_tex/Diss_JohZiegmann.bcf
  10. 15
      01_tex/Diss_JohZiegmann.blg
  11. 7
      01_tex/Diss_JohZiegmann.glg
  12. 0
      01_tex/Diss_JohZiegmann.glo
  13. 0
      01_tex/Diss_JohZiegmann.gls
  14. 31
      01_tex/Diss_JohZiegmann.ist
  15. 17
      01_tex/Diss_JohZiegmann.lof
  16. 15
      01_tex/Diss_JohZiegmann.lot
  17. 0
      01_tex/Diss_JohZiegmann.out
  18. BIN
      01_tex/Diss_JohZiegmann.pdf
  19. 88
      01_tex/Diss_JohZiegmann.run.xml
  20. 4
      01_tex/Diss_JohZiegmann.sbl
  21. 11
      01_tex/Diss_JohZiegmann.sym
  22. 85019
      01_tex/Diss_JohZiegmann.synctex
  23. 12
      01_tex/Diss_JohZiegmann.tcp
  24. 162
      01_tex/Diss_JohZiegmann.tex
  25. 99
      01_tex/Diss_JohZiegmann.toc
  26. 206
      01_tex/Diss_JohZiegmann.tps
  27. 50
      01_tex/chapters/a01_titlepage.tex
  28. 10
      01_tex/chapters/a02_preamble.tex
  29. 24
      01_tex/chapters/a03_abstract.tex
  30. 13
      01_tex/chapters/b01_symbols.tex
  31. 50
      01_tex/chapters/b02_acronyms.tex
  32. 48
      01_tex/chapters/ch01_introduction.tex
  33. 331
      01_tex/chapters/ch02_xxx.tex
  34. 107
      01_tex/chapters/ch03_xxx.tex
  35. 13
      01_tex/chapters/ch04_xxx.tex
  36. 13
      01_tex/chapters/ch05_xxx.tex
  37. 13
      01_tex/chapters/ch06_conclusion.tex
  38. 766
      01_tex/chapters/chapter_EOL.tex
  39. 343
      01_tex/chapters/chapter_stuff.tex
  40. 2382
      01_tex/chapters/chapter_time_series.tex
  41. 3
      01_tex/chapters/d01_appendix.tex
  42. 14
      01_tex/figures/00_matlab_fcn/legendflex/.gitignore
  43. 20
      01_tex/figures/00_matlab_fcn/legendflex/LICENSE.txt
  44. 521
      01_tex/figures/00_matlab_fcn/legendflex/README.html
  45. 352
      01_tex/figures/00_matlab_fcn/legendflex/README.m
  46. 324
      01_tex/figures/00_matlab_fcn/legendflex/README.md
  47. 37
      01_tex/figures/00_matlab_fcn/legendflex/legendflex/.gitignore
  48. 912
      01_tex/figures/00_matlab_fcn/legendflex/legendflex/legendflex.m
  49. BIN
      01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_01.png
  50. BIN
      01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_02.png
  51. BIN
      01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_03.png
  52. BIN
      01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_04.png
  53. BIN
      01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_05.png
  54. 37
      01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/.gitignore
  55. 182
      01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/getpos.m
  56. 104
      01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/setgetposexamples.m
  57. 189
      01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/setpos.m
  58. 6
      01_tex/figures/00_matlab_fcn/matlab2tikz/.gitignore
  59. 16
      01_tex/figures/00_matlab_fcn/matlab2tikz/.travis.yml
  60. 63
      01_tex/figures/00_matlab_fcn/matlab2tikz/AUTHORS.md
  61. 439
      01_tex/figures/00_matlab_fcn/matlab2tikz/CHANGELOG.md
  62. 66
      01_tex/figures/00_matlab_fcn/matlab2tikz/CONTRIBUTING.md
  63. 24
      01_tex/figures/00_matlab_fcn/matlab2tikz/LICENSE.md
  64. 95
      01_tex/figures/00_matlab_fcn/matlab2tikz/README.md
  65. 102
      01_tex/figures/00_matlab_fcn/matlab2tikz/logos/matlab2tikz.svg
  66. 49
      01_tex/figures/00_matlab_fcn/matlab2tikz/matlab2tikz.sublime-project
  67. 86
      01_tex/figures/00_matlab_fcn/matlab2tikz/runtests.sh
  68. 1294
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/cleanfigure.m
  69. 87
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/dev/formatWhitespace.m
  70. 123
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/figure2dot.m
  71. 231
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/m2tInputParser.m
  72. 6805
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/matlab2tikz.m
  73. 5
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/errorUnknownEnvironment.m
  74. 25
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/getEnvironment.m
  75. 13
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/guitypes.m
  76. 5
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/isAxis3D.m
  77. 13
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/isVersionBelow.m
  78. 310
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/m2tUpdater.m
  79. 35
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/m2tstrjoin.m
  80. 18
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/versionArray.m
  81. 9
      01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/versionString.m
  82. 101
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/README.md
  83. 280
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/codeReport.m
  84. 256
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/compareTimings.m
  85. 53
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/examples/example_bar_plot.m
  86. 80
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/examples/example_quivers.m
  87. 222
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/makeLatexReport.m
  88. 74
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/makeTapReport.m
  89. 360
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/makeTravisReport.m
  90. 4
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/output/.gitignore
  91. 36
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/OSVersion.m
  92. 74
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/StreamMaker.m
  93. 47
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/VersionControlIdentifier.m
  94. 35
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/calculateMD5Hash.m
  95. 19
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/cleanFiles.m
  96. 4
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/countNumberOfErrors.m
  97. 4
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/emptyStage.m
  98. 24
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/emptyStatus.m
  99. 41
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/errorHandler.m
  100. 16
      01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/errorHasOccurred.m
  101. Some files were not shown because too many files have changed in this diff Show More

192
01_tex/DissTeX.ahk

@ -0,0 +1,192 @@ @@ -0,0 +1,192 @@
; Date: 01.01.2019
; Author: Johannes Ziegmann
; Mail: Johannes.Ziegmann@gmail.com
; //////////////////////////////////////////////////////////////////////////////////////
; ONLY IF TeXnicCenter Windows is active
; //////////////////////////////////////////////////////////////////////////////////////
SetTitleMatchMode, regex
GroupAdd, TXC, ^.*TeXnicCenter.*$ ahk_class ^Afx:.+:.:.+:.+:.*$
#IfWinActive, ahk_group TXC
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments. They are not executed.
; This script has a special filename and path because it is automatically
; launched when you run the program directly. Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it. You can have as many .ahk
; files as you want, located in any folder. You can also run more than
; one .ahk file simultaneously and each will get its own tray icon.
; //////////////////////////////////////////////////////////////////////////////////////
; TUTORIAL ... https://ahkde.github.io/docs/Tutorial.htm
; Übersicht ... https://ahkde.github.io/docs/AutoHotkey.htm
; Example ... http://www.uweziegenhagen.de/?tag=autohotkey
; Example ... https://tex.stackexchange.com/questions/61547/using-autohotkey-to-streamline-latex-document-authoring
; //////////////////////////////////////////////////////////////////////////////////////
; USED SYNTAX EXPLANATION
; :o: omit ending character
; :?: triggers hotstring even between characters
; :c: case sensitive
; ^ CTRL
; # Windows
; ! ALT
; + Umschalt
; & zwei beliebige Tasten oder Maustasten zu Hotkey kombinieren
; //////////////////////////////////////////////////////////////////////////////////////
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; //////////////////////////////////////////////////////////////////////////////////////
; SCRIPT SETTINGS
#a::Suspend, Toggle ; toggle suspend script
#Hotstring EndChars `t ; tab is the only endchar for hotstrings
; //////////////////////////////////////////////////////////////////////////////////////
; GENERAL
; //////////////////////////////////////////////////////////////////////////////////////
; ********************************************************************
; -> GENERAL ...
^4:: Send $${Left}
^3:: Send {{}{}}{Left}
; ********************************************************************
; -> EQUATION ...
:o:baln::\begin{{}align{}}`r`r\end{{}align{}}{Up}`t ; align
:o:bgas::\begin{{}align{}}\begin{{}split{}}`r`r\end{{}split{}}\end{{}align{}}{Up}`t ; align with split
^e:: Send \begin{{}align{}} {Enter} {Enter}\end{{}align{}} {Left 14} {tab}
; Text(e.g. "enum") + CRT + Space
:*:enum#::\begin{{}enumerate{}}`r\item `r\item `r\item `r\end{{}enumerate{}}{UP 3}
:*:item#::\begin{{}itemize{}}`r\item `r\item `r\item `r\end{{}itemize{}}{UP 3}
; ********************************************************************
; -> FORMAT ...
; \section
:o:sc::%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`r\section{{}•{}}`r\label{{}sec:xxx{}}`r%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{Left 97}+{Left}
; \subsection
:o:ss::%==============================================================================`r\subsection{{}•{}}`r\label{{}subsec:xxx{}}`r%=============================================================================={Left 100}+{Left}
; \subsubsection
:o:sss::%------------------------------------------------------------------------------`r\subsubsection{{}•{}}`r\label{{}subsubsec:xxx{}}`r%------------------------------------------------------------------------------{Left 103}+{Left}
; \paragraph
:o:par::%-----------------------------------------`r\paragraph{{}•{}}`r\label{{}par:xxx{}}`r%-----------------------------------------{Left 60}+{Left}
; \clearpage
:o:clp::\clearpage
; ********************************************************************
; -> TEXT FORMAT (math) ...
:o:tx::\text{{}•{}}{Left}+{Left} ; \text
:o:tbf::\textbf{{}•{}}{Left}+{Left} ; \textbf
:o:bf::\mathbf{{}•{}}{Left}+{Left} ; \mathbf
:o:cal::\mathcal{{}•{}}{Left}+{Left} ; \mathcal
:o:bb::\mathbb{{}•{}}{Left}+{Left} ; \mathbb
:o:bbm::\mathbbm{{}•{}}{Left}+{Left} ; \mathbbm
; ********************************************************************
; -> Math helpers ...
:o?:^::{^}{{}{}}{Left} ; ^{}
:o?:_::_{{}{}}{Left} ; _{}
:o:exp::e{^}{{}{}}{Left} ; e^{}
:o:fra::\frac{{}•{}}{{}•{}}{Left 4}+{Left} ; \frac{}{}
:o:ovs::\overset{{}•{}}{{}•{}}{Left 4}+{Left} ; \overset
:o:sum::\sum_{{}•{}}{^}{{}•{}}{Left 5}+{Left} ; \sum
:o:pro::\prod_{{}•{}}{^}{{}•{}}{Left 5}+{Left} ; \prod
:o:int::\int_{{}•{}}{^}{{}•{}}{Left 5}+{Left} ; \int
:o:del::\partial ; \partial
:o:inf::\infty
:o:<=>::\Leftrightarrow
:o:=>::\Rightarrow
:o:->::\rightarrow
:o:!=::\overset{{}{!}{}}{{}={}}
:o:°::{^}\circ
:o:qd::\quad
:o:qq::\qquad
:o:=::\ =\{Space}
; ********************************************************************
; BRACKETS
^8:: Send \left( \right) {Left 9} ; \left( \right)
^9:: Send \left[ \right] {Left 9} ; \left[ \right]
^<:: Send \left< \right> {Left 9} ; \left< \right>
^7:: Send \left\{{} \right\{}} {Left 10} ; \left{ \right}
; ********************************************************************
; MATRICES, VECTORS, ...
^m:: Send \begin{{}matrix{}}\end{{}matrix{}}{Left 12}
^b:: Send \begin{{}{}} {Enter}\end{{}{}}{Left 10}
:o:pm2::\begin{{}pmatrix{}}`r0 & 0 \\`r0 & 0 \\`r\end{{}pmatrix{}}{Left 13}{Up}`t{Left}{Up}`t
:o:bm2::\begin{{}bmatrix{}}`r0 & 0 \\`r0 & 0 \\`r\end{{}bmatrix{}}{Left 13}{Up}`t{Left}{Up}`t
:o:pm3::\begin{{}pmatrix{}}`r0 & 0 & 0 \\`r0 & 0 & 0 \\`r0 & 0 & 0 \\`r\end{{}pmatrix{}}{Left 13}{Up}`t{Left}{Up}`t{Left}{Up}`t
:o:bm3::\begin{{}bmatrix{}}`r0 & 0 & 0 \\`r0 & 0 & 0 \\`r0 & 0 & 0 \\`r\end{{}bmatrix{}}{Left 13}{Up}`t{Left}{Up}`t{Left}{Up}`t
:o:pm4::\begin{{}pmatrix{}}`r0 & 0 & 0 & 0 \\`r0 & 0 & 0 & 0 \\`r0 & 0 & 0 & 0 \\`r0 & 0 & 0 & 0 \\`r\end{{}pmatrix{}}{Left 13}{Up}`t{Left}{Up}`t{Left}{Up}`t{Left}{Up}`t
:o:bm4::\begin{{}bmatrix{}}`r0 & 0 & 0 & 0 \\`r0 & 0 & 0 & 0 \\`r0 & 0 & 0 & 0 \\`r0 & 0 & 0 & 0 \\`r\end{{}bmatrix{}}{Left 13}{Up}`t{Left}{Up}`t{Left}{Up}`t{Left}{Up}`t
:o:lgs::\begin{{}cases{}}\;`r\begin{{}matrix{}}`rf & = & a & b \\`rf & = & c & d \\`r\end{{}matrix{}}`r\end{{}cases{}}{Left 11}{Up 2}`t{Left}{Up}`t
:o:v2::\begin{{}pmatrix{}}`r0 \\`r0 \\`r\end{{}pmatrix{}}{Left 13}{Up}`t{Left}{Up}`t
:o:v3::\begin{{}pmatrix{}}`r0 \\`r0 \\`r0 \\`r\end{{}pmatrix{}}{Left 13}{Up}`t{Left}{Up}`t{Left}{Up}`t
:o:v4::\begin{{}pmatrix{}}`r0 \\`r0 \\`r0 \\`r0 \\`r\end{{}pmatrix{}}{Left 13}{Up}`t{Left}{Up}`t{Left}{Up}`t{Left}{Up}`t
; //////////////////////////////////////////////////////////////////////////////////////
; GREEK
:o:a::\alpha
:o:b::\beta
:o:c::\chi
:oc:d::\delta
:oc:D::\Delta
:o:e::\epsilon
:o:ve::\varepsilon
:oc:f::\phi
:oc:F::\Phi
:o:vf::\varphi
:oc:g::\gamma
:oc:G::\Gamma
:o:h::\eta
:o:i::\iota
:o:k::\kappa
:oc:l::\lambda
:oc:L::\Lambda
:o:m::\mu
:o:n::\nu
:oc:p::\pi
:oc:P::\Pi
:oc:q::\theta
:oc:Q::\Theta
:o:vq::\vartheta
:o:r::\rho
:oc:s::\sigma
:oc:S::\Sigma
:o:t::\tau
:oc:u::\upsilon
:oc:U::\Upsilon
:o:v::\digamma
:oc:w::\omega
:oc:W::\Omega
:oc:x::\xi
:oc:X::\Xi
:oc:y::\psi
:oc:Y::\Psi
:o:z::\zeta
; //////////////////////////////////////////////////////////////////////////////////////
; ONLY IF TeXnicCenter Windows is active
; //////////////////////////////////////////////////////////////////////////////////////
#IfWinExist

3101
01_tex/Diss_JohZ.bib

File diff suppressed because one or more lines are too long

12
01_tex/Diss_JohZiegmann.acn

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
\glossaryentry{ANN?\glossentry{acr:ANN}|setentrycounter[]{page}\glsnumberformat}{xiv}
\glossaryentry{i.i.d.?\glossentry{acr:iid}|setentrycounter[]{page}\glsnumberformat}{xiv}
\glossaryentry{MSE?\glossentry{acr:MSE}|setentrycounter[]{page}\glsnumberformat}{xiv}
\glossaryentry{ANN?\glossentry{acr:ANN}|setentrycounter[]{page}\glsnumberformat}{xvi}
\glossaryentry{i.i.d.?\glossentry{acr:iid}|setentrycounter[]{page}\glsnumberformat}{xvi}
\glossaryentry{MSE?\glossentry{acr:MSE}|setentrycounter[]{page}\glsnumberformat}{xvi}
\glossaryentry{i.i.d.?\glossentry{acr:iid}|setentrycounter[]{page}\glsnumberformat}{4}
\glossaryentry{i.i.d.?\glossentry{acr:iid}|setentrycounter[]{page}\glsnumberformat}{5}
\glossaryentry{i.i.d.?\glossentry{acr:iid}|setentrycounter[]{page}\glsnumberformat}{6}
\glossaryentry{i.i.d.?\glossentry{acr:iid}|setentrycounter[]{page}\glsnumberformat}{6}
\glossaryentry{MSE?\glossentry{acr:MSE}|setentrycounter[]{page}\glsnumberformat}{23}
\glossaryentry{i.i.d.?\glossentry{acr:iid}|setentrycounter[]{page}\glsnumberformat}{23}

18
01_tex/Diss_JohZiegmann.acr

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble
\begin{theglossary}\glossaryheader
\glsgroupheading{A}\relax \glsresetentrylist %
\glossentry{acr:ANN}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{xiv}\delimN
\setentrycounter[]{page}\glsnumberformat{xvi}}}\glsgroupskip
\glsgroupheading{I}\relax \glsresetentrylist %
\glossentry{acr:iid}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{xiv}\delimN
\setentrycounter[]{page}\glsnumberformat{xvi}\delimN
\setentrycounter[]{page}\glsnumberformat{4\delimR 6}\delimN
\setentrycounter[]{page}\glsnumberformat{23}}}\glsgroupskip
\glsgroupheading{M}\relax \glsresetentrylist %
\glossentry{acr:MSE}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{xiv}\delimN
\setentrycounter[]{page}\glsnumberformat{xvi}\delimN
\setentrycounter[]{page}\glsnumberformat{23}}}%
\end{theglossary}\glossarypostamble

7
01_tex/Diss_JohZiegmann.alg

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
This is makeindex, version 2.15 [MiKTeX 2.9.6960 64-bit] (kpathsea + Thai support).
Scanning style file ./Diss_JohZiegmann.ist.............................done (29 attributes redefined, 0 ignored).
Scanning input file Diss_JohZiegmann.acn....done (12 entries accepted, 0 rejected).
Sorting entries....done (43 comparisons).
Generating output file Diss_JohZiegmann.acr....done (18 lines written, 0 warnings).
Output written in Diss_JohZiegmann.acr.
Transcript written in Diss_JohZiegmann.alg.

160
01_tex/Diss_JohZiegmann.aux

@ -0,0 +1,160 @@ @@ -0,0 +1,160 @@
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand*\new@tpo@label[2]{}
\abx@aux@refcontext{none/global//global/global}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\providecommand\BKM@entry[2]{}
\@input{chapters/a01_titlepage.aux}
\providecommand\@newglossary[4]{}
\@newglossary{main}{glg}{gls}{glo}
\@newglossary{acronym}{alg}{acr}{acn}
\@newglossary{symbols}{glg}{sym}{sbl}
\providecommand\@glsorder[1]{}
\providecommand\@istfilename[1]{}
\@istfilename{Diss_JohZiegmann.ist}
\@glsorder{word}
\@writefile{toc}{\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax }
\@writefile{lof}{\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax }
\@writefile{lot}{\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax }
\babel@aux{english}{}
\babel@aux{english}{}
\@input{chapters/a02_preamble.aux}
\@input{chapters/a03_abstract.aux}
\BKM@entry{id=1,dest={746F632E30},srcline={86}}{5C3337365C3337375C303030435C3030306F5C3030306E5C303030745C303030655C3030306E5C303030745C30303073}
\BKM@entry{id=2,dest={73656374696F6E2A2E35},srcline={91}}{5C3337365C3337375C3030304C5C303030695C303030735C303030745C3030305C3034305C3030306F5C303030665C3030305C3034305C303030465C303030695C303030675C303030755C303030725C303030655C30303073}
\@writefile{toc}{\contentsline {chapter}{List of Figures}{xi}{section*.5}\protected@file@percent }
\BKM@entry{id=3,dest={73656374696F6E2A2E37},srcline={96}}{5C3337365C3337375C3030304C5C303030695C303030735C303030745C3030305C3034305C3030306F5C303030665C3030305C3034305C303030545C303030615C303030625C3030306C5C303030655C30303073}
\@writefile{toc}{\contentsline {chapter}{List of Tables}{xiii}{section*.7}\protected@file@percent }
\@input{chapters/b01_symbols.aux}
\BKM@entry{id=4,dest={73656374696F6E2A2E3130},srcline={1}}{5C3337365C3337375C3030304E5C3030306F5C303030745C303030615C303030745C303030695C3030306F5C3030306E5C303030615C3030306C5C3030305C3034305C303030435C3030306F5C3030306E5C303030765C303030655C3030306E5C303030745C303030695C3030306F5C3030306E5C30303073}
\@input{chapters/b02_acronyms.aux}
\BKM@entry{id=5,dest={73656374696F6E2A2E3133},srcline={1}}{5C3337365C3337375C303030415C303030635C303030725C3030306F5C3030306E5C303030795C3030306D5C303030735C3030305C3034305C303030615C3030306E5C303030645C3030305C3034305C303030415C303030625C303030625C303030725C303030655C303030765C303030695C303030615C303030745C303030695C3030306F5C3030306E5C30303073}
\@input{chapters/ch01_introduction.aux}
\BKM@entry{id=6,dest={636861707465722E31},srcline={1}}{5C3337365C3337375C303030495C3030306E5C303030745C303030725C3030306F5C303030645C303030755C303030635C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=7,dest={73656374696F6E2E312E31},srcline={8}}{5C3337365C3337375C303030435C3030306F5C3030306E5C303030745C303030655C303030785C303030745C3030305C3034305C303030615C3030306E5C303030645C3030305C3034305C3030306D5C3030306F5C303030745C303030695C303030765C303030615C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=8,dest={73656374696F6E2E312E32},srcline={38}}{5C3337365C3337375C303030535C303030755C303030725C303030765C303030655C303030795C3030305C3034305C3030306F5C303030665C3030305C3034305C303030725C303030655C3030306C5C303030615C303030745C303030655C303030645C3030305C3034305C303030775C3030306F5C303030725C3030306B}
\BKM@entry{id=9,dest={73656374696F6E2E312E33},srcline={46}}{5C3337365C3337375C303030525C303030655C303030735C303030655C303030615C303030725C303030635C303030685C3030305C3034305C3030306F5C303030625C3030306A5C303030655C303030635C303030745C303030695C303030765C303030655C303030735C3030305C3034305C303030615C3030306E5C303030645C3030305C3034305C303030745C303030685C303030655C303030735C303030695C303030735C3030305C3034305C3030306F5C303030755C303030745C3030306C5C303030695C3030306E5C30303065}
\@input{chapters/ch02_xxx.aux}
\BKM@entry{id=10,dest={636861707465722E32},srcline={1}}{5C3337365C3337375C303030425C303030615C303030635C3030306B5C303030675C303030725C3030306F5C303030755C3030306E5C303030645C3030305C3034305C3030302F5C3030305C3034305C303030545C303030685C303030655C3030306F5C303030725C30303079}
\BKM@entry{id=11,dest={73656374696F6E2E322E31},srcline={11}}{5C3337365C3337375C303030545C303030685C303030655C3030305C3034305C303030425C303030615C303030795C303030655C303030735C303030695C303030615C3030306E5C3030305C3034305C303030465C303030725C303030615C3030306D5C303030655C303030775C3030306F5C303030725C3030306B}
\BKM@entry{id=12,dest={73756273656374696F6E2E322E312E31},srcline={21}}{5C3337365C3337375C3030304D5C3030306F5C303030645C303030655C3030306C5C303030695C3030306E5C303030675C3030305C3034305C303030765C303030695C303030615C3030305C3034305C303030455C303030785C303030635C303030685C303030615C3030306E5C303030675C303030655C303030615C303030625C303030695C3030306C5C303030695C303030745C30303079}
\BKM@entry{id=13,dest={73656374696F6E2E322E32},srcline={120}}{5C3337365C3337375C303030455C303030785C303030705C3030306F5C3030306E5C303030655C3030306E5C303030745C303030695C303030615C3030306C5C3030305C3034305C303030465C303030615C3030306D5C303030695C3030306C5C303030695C303030655C30303073}
\BKM@entry{id=14,dest={73756273656374696F6E2E322E322E31},srcline={179}}{5C3337365C3337375C303030505C303030725C3030306F5C303030705C303030655C303030725C303030745C303030695C303030655C303030735C3030305C3034305C3030306F5C303030665C3030305C3034305C303030745C303030685C303030655C3030305C3034305C303030435C303030615C3030306E5C3030306F5C3030306E5C303030695C303030635C303030615C3030306C5C3030305C3034305C303030455C303030785C303030705C3030306F5C3030306E5C303030655C3030306E5C303030745C303030695C303030615C3030306C5C3030305C3034305C303030465C303030615C3030306D5C303030695C3030306C5C30303079}
\BKM@entry{id=15,dest={73756273656374696F6E2E322E322E32},srcline={183}}{5C3337365C3337375C303030495C3030306E5C303030745C303030655C303030725C303030705C303030725C303030655C303030745C303030615C303030745C303030695C3030306F5C3030306E5C3030305C3034305C303030615C303030735C3030305C3034305C3030304C5C303030695C3030306E5C303030655C303030615C303030725C3030306C5C303030795C3030305C3034305C303030435C3030306F5C3030306E5C303030735C303030745C303030725C303030615C303030695C3030306E5C303030655C303030645C3030305C3034305C3030304D5C303030615C303030785C303030695C3030306D5C303030755C3030306D5C3030305C3034305C303030455C3030306E5C303030745C303030725C3030306F5C303030705C303030795C3030305C3034305C303030445C303030695C303030735C303030745C303030725C303030695C303030625C303030755C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=16,dest={73756273656374696F6E2E322E322E33},srcline={187}}{5C3337365C3337375C303030455C303030785C303030615C3030306D5C303030705C3030306C5C303030655C30303073}
\BKM@entry{id=17,dest={73656374696F6E2E322E33},srcline={192}}{5C3337365C3337375C303030535C303030755C303030665C303030665C303030695C303030635C303030695C303030655C3030306E5C303030745C3030305C3034305C303030535C303030745C303030615C303030745C303030695C303030735C303030745C303030695C303030635C30303073}
\BKM@entry{id=18,dest={73656374696F6E2E322E34},srcline={211}}{5C3337365C3337375C303030495C3030306E5C303030635C3030306F5C303030725C303030705C3030306F5C303030725C303030615C303030745C303030695C3030306E5C303030675C3030305C3034305C303030505C303030725C303030695C3030306F5C303030725C3030305C3034305C3030304B5C3030306E5C3030306F5C303030775C3030306C5C303030655C303030645C303030675C30303065}
\BKM@entry{id=19,dest={73756273656374696F6E2E322E342E31},srcline={216}}{5C3337365C3337375C303030435C3030306F5C3030306E5C3030306A5C303030755C303030675C303030615C303030745C303030655C3030305C3034305C303030505C303030725C303030695C3030306F5C303030725C30303073}
\BKM@entry{id=20,dest={73756273656374696F6E2E322E342E32},srcline={220}}{5C3337365C3337375C3030304D5C303030755C3030306C5C303030745C303030695C3030306E5C3030306F5C3030306D5C303030695C303030615C3030306C5C3030305C3034305C3030304F5C303030625C303030735C303030655C303030725C303030765C303030615C303030745C303030695C3030306F5C3030306E5C30303073}
\BKM@entry{id=21,dest={73756273656374696F6E2E322E342E33},srcline={224}}{5C3337365C3337375C303030475C303030615C303030755C303030735C303030735C303030695C303030615C3030306E5C3030305C3034305C3030304F5C303030625C303030735C303030655C303030725C303030765C303030615C303030745C303030695C3030306F5C3030306E5C30303073}
\BKM@entry{id=22,dest={73756273656374696F6E2E322E342E34},srcline={228}}{5C3337365C3337375C3030304D5C303030755C3030306C5C303030745C303030695C303030765C303030615C303030725C303030695C303030615C303030745C303030655C3030305C3034305C3030304C5C303030695C3030306E5C303030655C303030615C303030725C3030305C3034305C303030525C303030655C303030675C303030725C303030655C303030735C303030735C303030695C3030306F5C3030306E5C3030305C3034305C3030304D5C3030306F5C303030645C303030655C3030306C}
\BKM@entry{id=23,dest={73656374696F6E2E322E35},srcline={233}}{5C3337365C3337375C303030475C303030725C303030615C303030705C303030685C303030695C303030635C303030615C3030306C5C3030305C3034305C3030304D5C3030306F5C303030645C303030655C3030306C5C30303073}
\BKM@entry{id=24,dest={73756273656374696F6E2E322E352E31},srcline={238}}{5C3337365C3337375C303030415C3030305C3034305C303030425C303030725C303030695C303030655C303030665C3030305C3034305C3030304F5C303030765C303030655C303030725C303030765C303030695C303030655C30303077}
\BKM@entry{id=25,dest={73756273656374696F6E2E322E352E32},srcline={242}}{5C3337365C3337375C303030445C303030695C303030725C303030655C303030635C303030745C303030655C303030645C3030305C3034305C303030475C303030725C303030615C303030705C303030685C303030695C303030635C303030615C3030306C5C3030305C3034305C3030304D5C3030306F5C303030645C303030655C3030306C5C30303073}
\BKM@entry{id=26,dest={73756273656374696F6E2E322E352E33},srcline={246}}{5C3337365C3337375C303030555C3030306E5C303030645C303030695C303030725C303030655C303030635C303030745C303030655C303030645C3030305C3034305C303030475C303030725C303030615C303030705C303030685C303030695C303030635C303030615C3030306C5C3030305C3034305C3030304D5C3030306F5C303030645C303030655C3030306C5C30303073}
\BKM@entry{id=27,dest={73756273656374696F6E2E322E352E34},srcline={250}}{5C3337365C3337375C303030425C303030655C3030306C5C303030695C303030655C303030665C3030305C3034305C303030505C303030725C3030306F5C303030705C303030615C303030675C303030615C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=28,dest={73656374696F6E2E322E36},srcline={255}}{5C3337365C3337375C303030485C303030695C303030645C303030645C303030655C3030306E5C3030305C3034305C3030304D5C303030615C303030725C3030306B5C3030306F5C303030765C3030305C3034305C3030304D5C3030306F5C303030645C303030655C3030306C}
\BKM@entry{id=29,dest={73756273656374696F6E2E322E362E31},srcline={259}}{5C3337365C3337375C303030465C3030306F5C303030725C303030775C303030615C303030725C303030645C3030302D5C303030425C303030615C303030635C3030306B5C303030775C303030615C303030725C303030645C3030305C3034305C303030415C3030306C5C303030675C3030306F5C303030725C303030695C303030745C303030685C3030306D}
\BKM@entry{id=30,dest={73756273656374696F6E2E322E362E32},srcline={263}}{5C3337365C3337375C303030565C303030695C303030745C303030655C303030725C303030625C303030695C3030305C3034305C303030415C3030306C5C303030675C3030306F5C303030725C303030695C303030745C303030685C3030306D}
\BKM@entry{id=31,dest={73656374696F6E2E322E37},srcline={268}}{5C3337365C3337375C303030535C303030745C303030615C303030745C303030655C3030305C3034305C303030535C303030705C303030615C303030635C303030655C3030305C3034305C3030304D5C3030306F5C303030645C303030655C3030306C5C30303073}
\BKM@entry{id=32,dest={73756273656374696F6E2E322E372E31},srcline={272}}{5C3337365C3337375C303030535C303030745C303030615C3030306E5C303030645C303030615C303030725C303030645C3030305C3034305C303030445C303030695C303030735C303030635C303030725C303030655C303030745C303030655C3030302D5C303030545C303030695C3030306D5C303030655C3030305C3034305C3030304C5C303030695C3030306E5C303030655C303030615C303030725C3030302D5C303030475C303030615C303030755C303030735C303030735C303030695C303030615C3030306E5C3030305C3034305C303030535C303030745C303030615C303030745C303030655C3030305C3034305C303030535C303030705C303030615C303030635C303030655C3030305C3034305C303030465C3030306F5C303030725C3030306D5C303030755C3030306C5C303030615C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=33,dest={73756273656374696F6E2E322E372E32},srcline={276}}{5C3337365C3337375C303030565C303030655C303030635C303030745C3030306F5C303030725C3030305C3034305C303030415C303030755C303030745C3030306F5C303030725C303030655C303030675C303030725C303030655C303030735C303030735C303030695C303030765C303030655C3030305C3034305C303030505C303030725C3030306F5C303030635C303030655C303030735C303030735C303030655C30303073}
\BKM@entry{id=34,dest={73756273656374696F6E2E322E372E33},srcline={280}}{5C3337365C3337375C303030535C303030775C303030695C303030745C303030635C303030685C303030695C3030306E5C303030675C3030305C3034305C3030304C5C303030695C3030306E5C303030655C303030615C303030725C3030305C3034305C303030445C303030795C3030306E5C303030615C3030306D5C303030695C303030635C3030305C3034305C303030535C303030795C303030735C303030745C303030655C3030306D5C30303073}
\BKM@entry{id=35,dest={73756273656374696F6E2E322E372E34},srcline={284}}{5C3337365C3337375C303030535C303030745C3030306F5C303030635C303030685C303030615C303030735C303030745C303030695C303030635C3030305C3034305C303030525C303030655C303030615C3030306C5C303030695C3030307A5C303030615C303030745C303030695C3030306F5C3030306E5C3030305C3034305C303030545C303030685C303030655C3030306F5C303030725C30303079}
\BKM@entry{id=36,dest={73756273656374696F6E2E322E372E35},srcline={288}}{5C3337365C3337375C3030304B5C303030615C3030306C5C3030306D5C303030615C3030306E5C3030305C3034305C303030465C303030695C3030306C5C303030745C303030655C303030725C303030695C3030306E5C303030675C3030305C3034305C303030615C3030306E5C303030645C3030305C3034305C303030535C3030306D5C3030306F5C3030306F5C303030745C303030685C303030695C3030306E5C30303067}
\BKM@entry{id=37,dest={73656374696F6E2E322E38},srcline={292}}{5C3337365C3337375C3030304D5C303030615C303030725C3030306B5C3030306F5C303030765C3030305C3034305C303030435C303030685C303030615C303030695C3030306E5C3030305C3034305C3030304D5C3030306F5C3030306E5C303030745C303030655C3030305C3034305C303030435C303030615C303030725C3030306C5C3030306F}
\BKM@entry{id=38,dest={73756273656374696F6E2E322E382E31},srcline={296}}{5C3337365C3337375C3030304D5C3030306F5C3030306E5C303030745C303030655C3030305C3034305C303030435C303030615C303030725C3030306C5C3030306F5C3030305C3034305C303030495C3030306E5C303030745C303030655C303030675C303030725C303030615C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=39,dest={73756273656374696F6E2E322E382E32},srcline={300}}{5C3337365C3337375C303030545C303030685C303030655C3030305C3034305C3030304D5C303030655C303030745C303030725C3030306F5C303030705C3030306F5C3030306C5C303030695C303030735C3030302D5C303030485C303030615C303030735C303030745C303030695C3030306E5C303030675C303030735C3030305C3034305C303030415C3030306C5C303030675C3030306F5C303030725C303030695C303030745C303030685C3030306D}
\BKM@entry{id=40,dest={73756273656374696F6E2E322E382E33},srcline={304}}{5C3337365C3337375C303030475C303030695C303030625C303030625C303030735C3030305C3034305C303030535C303030615C3030306D5C303030705C3030306C5C303030695C3030306E5C30303067}
\BKM@entry{id=41,dest={73756273656374696F6E2E322E382E34},srcline={308}}{5C3337365C3337375C303030415C303030755C303030785C303030695C3030306C5C303030695C303030615C303030725C303030795C3030302C5C3030305C3034305C303030425C3030306C5C3030306F5C303030635C3030306B5C303030655C303030645C3030302C5C3030305C3034305C303030615C3030306E5C303030645C3030305C3034305C303030435C3030306F5C3030306C5C3030306C5C303030615C303030705C303030735C303030655C303030645C3030305C3034305C303030475C303030695C303030625C303030625C303030735C3030305C3034305C303030535C303030615C3030306D5C303030705C3030306C5C303030655C303030725C30303073}
\BKM@entry{id=42,dest={73656374696F6E2E322E39},srcline={313}}{5C3337365C3337375C303030425C303030615C303030795C303030655C303030735C303030695C303030615C3030306E5C3030305C3034305C3030304E5C3030306F5C3030306E5C303030705C303030615C303030725C303030615C3030306D5C303030655C303030745C303030725C303030695C303030635C3030305C3034305C3030304D5C303030655C303030745C303030685C3030306F5C303030645C30303073}
\BKM@entry{id=43,dest={73756273656374696F6E2E322E392E31},srcline={317}}{5C3337365C3337375C303030445C303030695C303030725C303030695C303030635C303030685C3030306C5C303030655C303030745C3030305C3034305C303030505C303030725C3030306F5C303030635C303030655C303030735C303030735C303030655C30303073}
\BKM@entry{id=44,dest={73756273656374696F6E2E322E392E32},srcline={321}}{5C3337365C3337375C303030445C303030695C303030725C303030695C303030635C303030685C3030306C5C303030655C303030745C3030305C3034305C303030505C303030725C3030306F5C303030635C303030655C303030735C303030735C3030305C3034305C3030304D5C303030695C303030785C303030745C303030755C303030725C303030655C3030305C3034305C3030304D5C3030306F5C303030645C303030655C3030306C5C30303073}
\BKM@entry{id=45,dest={73756273656374696F6E2E322E392E33},srcline={325}}{5C3337365C3337375C303030485C303030695C303030655C303030725C303030615C303030725C303030635C303030685C303030695C303030635C303030615C3030306C5C3030305C3034305C303030445C303030695C303030725C303030695C303030635C303030685C3030306C5C303030655C303030745C3030305C3034305C303030505C303030725C3030306F5C303030635C303030655C303030735C303030735C303030655C30303073}
\BKM@entry{id=46,dest={73756273656374696F6E2E322E392E34},srcline={329}}{5C3337365C3337375C303030425C303030655C303030745C303030615C3030305C3034305C303030505C303030725C3030306F5C303030635C303030655C303030735C30303073}
\@input{chapters/ch03_xxx.aux}
\BKM@entry{id=47,dest={636861707465722E33},srcline={1}}{5C3337365C3337375C303030525C3030306F5C303030755C303030745C303030655C3030302F5C303030545C303030725C303030615C3030306A5C303030655C303030635C303030745C3030306F5C303030725C303030795C3030305C3034305C303030505C303030725C303030655C303030645C303030695C303030635C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=48,dest={73656374696F6E2E332E31},srcline={5}}{5C3337365C3337375C303030535C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=49,dest={73756273656374696F6E2E332E312E31},srcline={105}}{5C3337365C3337375C303030535C303030755C303030625C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\@input{chapters/ch04_xxx.aux}
\BKM@entry{id=50,dest={636861707465722E34},srcline={1}}{5C3337365C3337375C303030505C303030725C303030655C303030645C303030695C303030635C303030745C303030695C3030306F5C3030306E5C3030305C3034305C3030306F5C303030665C3030305C3034305C303030645C303030725C303030695C303030765C303030655C303030725C3030305C3034305C303030695C3030306E5C303030665C3030306C5C303030755C303030655C3030306E5C303030635C303030655C303030645C3030305C3034305C303030705C303030615C303030725C303030615C3030306D5C303030655C303030745C303030655C303030725C3030305C3034305C3030305C3035305C303030765C303030655C3030306C5C3030306F5C303030635C303030695C303030745C303030795C3030305C3034305C303030615C3030306E5C303030645C3030305C3034305C3030306C5C3030306F5C3030306E5C303030675C303030695C303030745C303030755C303030645C303030695C3030306E5C303030615C3030306C5C3030305C3034305C303030615C3030306E5C303030645C3030305C3034305C3030306C5C303030615C303030745C303030655C303030725C303030615C3030306C5C3030305C3034305C303030615C303030635C303030635C303030655C3030306C5C303030655C303030725C303030615C303030745C303030695C3030306F5C3030306E5C3030305C303531}
\BKM@entry{id=51,dest={73656374696F6E2E342E31},srcline={5}}{5C3337365C3337375C303030535C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=52,dest={73756273656374696F6E2E342E312E31},srcline={11}}{5C3337365C3337375C303030535C303030755C303030625C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\@input{chapters/ch05_xxx.aux}
\BKM@entry{id=53,dest={636861707465722E35},srcline={1}}{5C3337365C3337375C303030465C303030695C303030665C303030745C303030685C3030305C3034305C303030435C303030685C303030615C303030705C303030745C303030655C30303072}
\BKM@entry{id=54,dest={73656374696F6E2E352E31},srcline={5}}{5C3337365C3337375C303030535C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=55,dest={73756273656374696F6E2E352E312E31},srcline={11}}{5C3337365C3337375C303030535C303030755C303030625C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\@input{chapters/ch06_conclusion.aux}
\BKM@entry{id=56,dest={636861707465722E36},srcline={1}}{5C3337365C3337375C303030435C3030306F5C3030306E5C303030635C3030306C5C303030755C303030735C303030695C3030306F5C3030306E}
\BKM@entry{id=57,dest={73656374696F6E2E362E31},srcline={5}}{5C3337365C3337375C303030535C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=58,dest={73756273656374696F6E2E362E312E31},srcline={11}}{5C3337365C3337375C303030535C303030755C303030625C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E}
\@input{chapters/chapter_stuff.aux}
\BKM@entry{id=59,dest={636861707465722E37},srcline={1}}{5C3337365C3337375C303030545C303030655C303030735C303030745C3030305C3034305C303030435C303030685C303030615C303030705C303030745C303030655C30303072}
\BKM@entry{id=60,dest={73656374696F6E2E372E31},srcline={7}}{5C3337365C3337375C303030545C3030306F5C303030445C3030306F5C303030275C30303073}
\BKM@entry{id=61,dest={73656374696F6E2E372E32},srcline={50}}{5C3337365C3337375C3030304E5C3030306F5C303030745C303030655C30303073}
\BKM@entry{id=62,dest={73656374696F6E2E372E33},srcline={65}}{5C3337365C3337375C303030465C303030695C303030785C3030304D5C30303065}
\BKM@entry{id=63,dest={73656374696F6E2E372E34},srcline={79}}{5C3337365C3337375C303030435C303030695C303030745C30303065}
\abx@aux@cite{Kuipers.2000}
\abx@aux@segm{0}{0}{Kuipers.2000}
\abx@aux@cite{Boor.1972}
\abx@aux@segm{0}{0}{Boor.1972}
\abx@aux@cite{Waldron.2016}
\abx@aux@segm{0}{0}{Waldron.2016}
\abx@aux@cite{Biagiotti.2008}
\abx@aux@segm{0}{0}{Biagiotti.2008}
\abx@aux@segm{0}{0}{Biagiotti.2008}
\abx@aux@cite{Dahlquist.2008}
\abx@aux@segm{0}{0}{Dahlquist.2008}
\BKM@entry{id=64,dest={73656374696F6E2E372E35},srcline={94}}{5C3337365C3337375C303030475C3030306C5C3030306F5C303030735C303030735C303030615C303030725C303030695C303030655C30303073}
\BKM@entry{id=65,dest={73656374696F6E2E372E36},srcline={114}}{5C3337365C3337375C303030525C303030655C303030665C303030655C303030725C303030655C3030306E5C303030635C30303065}
\BKM@entry{id=66,dest={73656374696F6E2E372E37},srcline={125}}{5C3337365C3337375C3030304D5C303030615C303030635C303030725C3030306F5C30303073}
\BKM@entry{id=67,dest={73756273656374696F6E2E372E372E31},srcline={130}}{5C3337365C3337375C303030455C303030715C303030755C303030615C303030745C303030695C3030306F5C3030306E5C30303073}
\BKM@entry{id=68,dest={73756273656374696F6E2E372E372E32},srcline={151}}{5C3337365C3337375C303030465C303030755C3030306E5C303030635C303030745C303030695C3030306F5C3030306E}
\BKM@entry{id=69,dest={73656374696F6E2E372E38},srcline={159}}{5C3337365C3337375C303030545C303030615C303030625C3030306C5C30303065}
\BKM@entry{id=70,dest={73656374696F6E2E372E39},srcline={183}}{5C3337365C3337375C303030465C303030695C303030675C303030755C303030725C303030655C30303073}
\BKM@entry{id=71,dest={636861707465722E38},srcline={325}}{5C3337365C3337375C303030485C303030655C303030615C303030645C303030695C3030306E5C303030675C3030305C3034305C3030306F5C3030306E5C3030305C3034305C3030306C5C303030655C303030765C303030655C3030306C5C3030305C3034305C303030305C3030305C3034305C3030305C3035305C303030635C303030685C303030615C303030705C303030745C303030655C303030725C3030305C303531}
\BKM@entry{id=72,dest={73656374696F6E2E382E31},srcline={325}}{5C3337365C3337375C303030485C303030655C303030615C303030645C303030695C3030306E5C303030675C3030305C3034305C3030306F5C3030306E5C3030305C3034305C3030306C5C303030655C303030765C303030655C3030306C5C3030305C3034305C303030315C3030305C3034305C3030305C3035305C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E5C3030305C303531}
\BKM@entry{id=73,dest={73756273656374696F6E2E382E312E31},srcline={325}}{5C3337365C3337375C303030485C303030655C303030615C303030645C303030695C3030306E5C303030675C3030305C3034305C3030306F5C3030306E5C3030305C3034305C3030306C5C303030655C303030765C303030655C3030306C5C3030305C3034305C303030325C3030305C3034305C3030305C3035305C303030735C303030755C303030625C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E5C3030305C303531}
\BKM@entry{id=74,dest={73656374696F6E2E382E32},srcline={325}}{5C3337365C3337375C3030304C5C303030695C303030735C303030745C30303073}
\BKM@entry{id=75,dest={73756273656374696F6E2E382E322E31},srcline={325}}{5C3337365C3337375C303030455C303030785C303030615C3030306D5C303030705C3030306C5C303030655C3030305C3034305C303030665C3030306F5C303030725C3030305C3034305C3030306C5C303030695C303030735C303030745C3030305C3034305C3030305C3035305C303030695C303030745C303030655C3030306D5C303030695C3030307A5C303030655C3030305C303531}
\BKM@entry{id=76,dest={73756273656374696F6E2E382E322E32},srcline={325}}{5C3337365C3337375C303030455C303030785C303030615C3030306D5C303030705C3030306C5C303030655C3030305C3034305C303030665C3030306F5C303030725C3030305C3034305C3030306C5C303030695C303030735C303030745C3030305C3034305C3030305C3035305C303030655C3030306E5C303030755C3030306D5C303030655C303030725C303030615C303030745C303030655C3030305C303531}
\BKM@entry{id=77,dest={73756273656374696F6E2E382E322E33},srcline={325}}{5C3337365C3337375C303030455C303030785C303030615C3030306D5C303030705C3030306C5C303030655C3030305C3034305C303030665C3030306F5C303030725C3030305C3034305C3030306C5C303030695C303030735C303030745C3030305C3034305C3030305C3035305C303030645C303030655C303030735C303030635C303030725C303030695C303030705C303030745C303030695C3030306F5C3030306E5C3030305C303531}
\BKM@entry{id=78,dest={636861707465722E39},srcline={326}}{5C3337365C3337375C303030485C303030655C303030615C303030645C303030695C3030306E5C303030675C3030305C3034305C3030306F5C3030306E5C3030305C3034305C3030306C5C303030655C303030765C303030655C3030306C5C3030305C3034305C303030305C3030305C3034305C3030305C3035305C303030635C303030685C303030615C303030705C303030745C303030655C303030725C3030305C303531}
\BKM@entry{id=79,dest={73656374696F6E2E392E31},srcline={326}}{5C3337365C3337375C303030485C303030655C303030615C303030645C303030695C3030306E5C303030675C3030305C3034305C3030306F5C3030306E5C3030305C3034305C3030306C5C303030655C303030765C303030655C3030306C5C3030305C3034305C303030315C3030305C3034305C3030305C3035305C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E5C3030305C303531}
\BKM@entry{id=80,dest={73756273656374696F6E2E392E312E31},srcline={326}}{5C3337365C3337375C303030485C303030655C303030615C303030645C303030695C3030306E5C303030675C3030305C3034305C3030306F5C3030306E5C3030305C3034305C3030306C5C303030655C303030765C303030655C3030306C5C3030305C3034305C303030325C3030305C3034305C3030305C3035305C303030735C303030755C303030625C303030735C303030655C303030635C303030745C303030695C3030306F5C3030306E5C3030305C303531}
\BKM@entry{id=81,dest={73656374696F6E2E392E32},srcline={326}}{5C3337365C3337375C3030304C5C303030695C303030735C303030745C30303073}
\BKM@entry{id=82,dest={73756273656374696F6E2E392E322E31},srcline={326}}{5C3337365C3337375C303030455C303030785C303030615C3030306D5C303030705C3030306C5C303030655C3030305C3034305C303030665C3030306F5C303030725C3030305C3034305C3030306C5C303030695C303030735C303030745C3030305C3034305C3030305C3035305C303030695C303030745C303030655C3030306D5C303030695C3030307A5C303030655C3030305C303531}
\BKM@entry{id=83,dest={73756273656374696F6E2E392E322E32},srcline={326}}{5C3337365C3337375C303030455C303030785C303030615C3030306D5C303030705C3030306C5C303030655C3030305C3034305C303030665C3030306F5C303030725C3030305C3034305C3030306C5C303030695C303030735C303030745C3030305C3034305C3030305C3035305C303030655C3030306E5C303030755C3030306D5C303030655C303030725C303030615C303030745C303030655C3030305C303531}
\BKM@entry{id=84,dest={73756273656374696F6E2E392E322E33},srcline={326}}{5C3337365C3337375C303030455C303030785C303030615C3030306D5C303030705C3030306C5C303030655C3030305C3034305C303030665C3030306F5C303030725C3030305C3034305C3030306C5C303030695C303030735C303030745C3030305C3034305C3030305C3035305C303030645C303030655C303030735C303030635C303030725C303030695C303030705C303030745C303030695C3030306F5C3030306E5C3030305C303531}
\@input{chapters/d01_appendix.aux}
\BKM@entry{id=85,dest={617070656E6469782E41},srcline={2}}{5C3337365C3337375C303030415C303030705C303030705C303030655C3030306E5C303030645C303030695C30303078}
\BKM@entry{id=86,dest={73656374696F6E2A2E3331},srcline={150}}{5C3337365C3337375C303030425C303030695C303030625C3030306C5C303030695C3030306F5C303030675C303030725C303030615C303030705C303030685C30303079}
\abx@aux@refcontextdefaultsdone
\abx@aux@defaultrefcontext{0}{Kuipers.2000}{none/global//global/global}
\abx@aux@defaultrefcontext{0}{Boor.1972}{none/global//global/global}
\abx@aux@defaultrefcontext{0}{Waldron.2016}{none/global//global/global}
\abx@aux@defaultrefcontext{0}{Biagiotti.2008}{none/global//global/global}
\abx@aux@defaultrefcontext{0}{Dahlquist.2008}{none/global//global/global}
\@writefile{toc}{\contentsline {chapter}{Bibliography}{XIX}{section*.31}\protected@file@percent }
\ttl@finishall
\global\csname @altsecnumformattrue\endcsname
\global\@namedef{scr@dte@chapter@lastmaxnumwidth}{15.5939pt}
\global\@namedef{scr@dte@section@lastmaxnumwidth}{19.71382pt}
\global\@namedef{scr@dte@subsection@lastmaxnumwidth}{28.8528pt}
\global\@namedef{scr@dte@table@lastmaxnumwidth}{19.71382pt}
\global\@namedef{scr@dte@figure@lastmaxnumwidth}{19.71382pt}

1
01_tex/Diss_JohZiegmann.auxlock

@ -0,0 +1 @@ @@ -0,0 +1 @@
\def \tikzexternallocked {0}

188
01_tex/Diss_JohZiegmann.bbl

@ -0,0 +1,188 @@ @@ -0,0 +1,188 @@
% $ biblatex auxiliary file $
% $ biblatex bbl format version 3.0 $
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated by
% biber as required.
%
\begingroup
\makeatletter
\@ifundefined{ver@biblatex.sty}
{\@latex@error
{Missing 'biblatex' package}
{The bibliography requires the 'biblatex' package.}
\aftergroup\endinput}
{}
\endgroup
\refsection{0}
\datalist[entry]{none/global//global/global}
\entry{Kuipers.2000}{article}{}
\name{author}{1}{}{%
{{hash=4f2e5d9dd80a859c46c1fd20f16f84ec}{%
family={Kuipers},
familyi={K\bibinitperiod},
given={Jack},
giveni={J\bibinitperiod}}}%
}
\strng{namehash}{4f2e5d9dd80a859c46c1fd20f16f84ec}
\strng{fullhash}{4f2e5d9dd80a859c46c1fd20f16f84ec}
\strng{bibnamehash}{4f2e5d9dd80a859c46c1fd20f16f84ec}
\strng{authorbibnamehash}{4f2e5d9dd80a859c46c1fd20f16f84ec}
\strng{authornamehash}{4f2e5d9dd80a859c46c1fd20f16f84ec}
\strng{authorfullhash}{4f2e5d9dd80a859c46c1fd20f16f84ec}
\field{sortinit}{1}
\field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{journaltitle}{{Geometry, Integrability {\&} Quantization}}
\field{title}{{Quaternions and Rotation Sequences}}
\field{volume}{1}
\field{year}{2000}
\field{pages}{127\bibrangedash 143}
\range{pages}{17}
\endentry
\entry{Boor.1972}{article}{}
\name{author}{1}{}{%
{{hash=11c4e53ad7afb115a36f6c81c99701de}{%
family={Boor},
familyi={B\bibinitperiod},
given={Carl},
giveni={C\bibinitperiod},
prefix={de},
prefixi={d\bibinitperiod}}}%
}
\strng{namehash}{11c4e53ad7afb115a36f6c81c99701de}
\strng{fullhash}{11c4e53ad7afb115a36f6c81c99701de}
\strng{bibnamehash}{11c4e53ad7afb115a36f6c81c99701de}
\strng{authorbibnamehash}{11c4e53ad7afb115a36f6c81c99701de}
\strng{authornamehash}{11c4e53ad7afb115a36f6c81c99701de}
\strng{authorfullhash}{11c4e53ad7afb115a36f6c81c99701de}
\field{sortinit}{2}
\field{sortinithash}{cbff857e587bcb4635511624d773949e}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{journaltitle}{{Journal of Approximation Theory}}
\field{number}{1}
\field{title}{{On calculating with B-splines}}
\field{volume}{6}
\field{year}{1972}
\field{pages}{50\bibrangedash 62}
\range{pages}{13}
\endentry
\entry{Waldron.2016}{incollection}{}
\name{author}{2}{}{%
{{hash=7c0dce7f42dd410cdeaf86525f73def3}{%
family={Waldron},
familyi={W\bibinitperiod},
given={Kenneth\bibnamedelima J.},
giveni={K\bibinitperiod\bibinitdelim J\bibinitperiod}}}%
{{hash=08622e2b53ad4a19e34b32bc031fa1d1}{%
family={Schmiedeler},
familyi={S\bibinitperiod},
given={James},
giveni={J\bibinitperiod}}}%
}
\name{editor}{2}{}{%
{{hash=38f7a70abf2d86e432d63826f560ab93}{%
family={Siciliano},
familyi={S\bibinitperiod},
given={Bruno},
giveni={B\bibinitperiod}}}%
{{hash=a1ed48939870abd896792330bc735967}{%
family={Khatib},
familyi={K\bibinitperiod},
given={Oussama},
giveni={O\bibinitperiod}}}%
}
\list{publisher}{1}{%
{Springer Berlin Heidelberg}%
}
\strng{namehash}{54f9d8168a049f14446ab05713447dfc}
\strng{fullhash}{54f9d8168a049f14446ab05713447dfc}
\strng{bibnamehash}{54f9d8168a049f14446ab05713447dfc}
\strng{authorbibnamehash}{54f9d8168a049f14446ab05713447dfc}
\strng{authornamehash}{54f9d8168a049f14446ab05713447dfc}
\strng{authorfullhash}{54f9d8168a049f14446ab05713447dfc}
\strng{editorbibnamehash}{0bdecfa7d3574a8d04c99af970a7506e}
\strng{editornamehash}{0bdecfa7d3574a8d04c99af970a7506e}
\strng{editorfullhash}{0bdecfa7d3574a8d04c99af970a7506e}
\field{sortinit}{3}
\field{sortinithash}{a4b52e5432884761f50fb9571273b93e}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{booktitle}{{Springer Handbook of Robotics}}
\field{isbn}{978-3-319-32550-7}
\field{title}{{Kinematics}}
\field{year}{2016}
\field{pages}{11\bibrangedash 35}
\range{pages}{25}
\endentry
\entry{Biagiotti.2008}{book}{}
\name{author}{2}{}{%
{{hash=19f06cd7f0aa050f4be4280dcc9b8c8c}{%
family={Biagiotti},
familyi={B\bibinitperiod},
given={Luigi},
giveni={L\bibinitperiod}}}%
{{hash=580ae604502d9ceaecb55ba8183987e0}{%
family={Melchiorri},
familyi={M\bibinitperiod},
given={Claudio},
giveni={C\bibinitperiod}}}%
}
\list{location}{1}{%
{Berlin Heidelberg}%
}
\list{publisher}{1}{%
{Springer Berlin Heidelberg}%
}
\strng{namehash}{62caec430059b4372692bb48cc0aac88}
\strng{fullhash}{62caec430059b4372692bb48cc0aac88}
\strng{bibnamehash}{62caec430059b4372692bb48cc0aac88}
\strng{authorbibnamehash}{62caec430059b4372692bb48cc0aac88}
\strng{authornamehash}{62caec430059b4372692bb48cc0aac88}
\strng{authorfullhash}{62caec430059b4372692bb48cc0aac88}
\field{sortinit}{4}
\field{sortinithash}{11cdaee3b18e01d77f3f428b13c1fc76}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{isbn}{978-3-540-85628-3}
\field{title}{{Trajectory Planning for Automatic Machines and Robots}}
\field{year}{2008}
\endentry
\entry{Dahlquist.2008}{book}{}
\name{author}{1}{}{%
{{hash=eba36fa64fd03e404faf1db63256dd3e}{%
family={Dahlquist},
familyi={D\bibinitperiod},
given={Germund},
giveni={G\bibinitperiod}}}%
}
\list{location}{1}{%
{Philadelphia}%
}
\list{publisher}{1}{%
{Society for Industrial and Applied Mathematics}%
}
\strng{namehash}{eba36fa64fd03e404faf1db63256dd3e}
\strng{fullhash}{eba36fa64fd03e404faf1db63256dd3e}
\strng{bibnamehash}{eba36fa64fd03e404faf1db63256dd3e}
\strng{authorbibnamehash}{eba36fa64fd03e404faf1db63256dd3e}
\strng{authornamehash}{eba36fa64fd03e404faf1db63256dd3e}
\strng{authorfullhash}{eba36fa64fd03e404faf1db63256dd3e}
\field{sortinit}{6}
\field{sortinithash}{57e57fb8451e7fcfa45d1e069f6d3136}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{abstract}{Principles of numerical calculations -- How to obtain and estimate accuracy -- Series, operators, and continued fractions --Interpolation and approximation -- Numerical integration -- Solving scalar nonlinear equations}
\field{isbn}{978-0-898716-44-3}
\field{title}{{Numerical methods in scientific computing}}
\field{year}{2008}
\endentry
\enddatalist
\endrefsection
\endinput

2022
01_tex/Diss_JohZiegmann.bcf

File diff suppressed because it is too large Load Diff

15
01_tex/Diss_JohZiegmann.blg

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
[0] Config.pm:304> INFO - This is Biber 2.12
[1] Config.pm:307> INFO - Logfile is 'Diss_JohZiegmann.blg'
[42] biber-MSWIN64:315> INFO - ===
[80] Biber.pm:371> INFO - Reading 'Diss_JohZiegmann.bcf'
[176] Biber.pm:889> INFO - Found 5 citekeys in bib section 0
[189] Biber.pm:4093> INFO - Processing section 0
[206] Biber.pm:4254> INFO - Looking for bibtex format file 'mybib.bib' for section 0
[218] bibtex.pm:1523> INFO - LaTeX decoding ...
[438] bibtex.pm:1340> INFO - Found BibTeX data source 'mybib.bib'
[598] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
[598] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
[598] Biber.pm:3921> INFO - Sorting list 'none/global//global/global' of type 'entry' with template 'none' and locale 'en-US'
[598] Biber.pm:3927> INFO - No sort tailoring available for locale 'en-US'
[602] bbl.pm:636> INFO - Writing 'Diss_JohZiegmann.bbl' with encoding 'UTF-8'
[604] bbl.pm:739> INFO - Output to Diss_JohZiegmann.bbl

7
01_tex/Diss_JohZiegmann.glg

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
This is makeindex, version 2.15 [MiKTeX 2.9.6960 64-bit] (kpathsea + Thai support).
Scanning style file ./Diss_JohZiegmann.ist.............................done (29 attributes redefined, 0 ignored).
Scanning input file Diss_JohZiegmann.sbl....done (4 entries accepted, 0 rejected).
Sorting entries....done (9 comparisons).
Generating output file Diss_JohZiegmann.sym....done (11 lines written, 0 warnings).
Output written in Diss_JohZiegmann.sym.
Transcript written in Diss_JohZiegmann.glg.

0
01_tex/Diss_JohZiegmann.glo

0
01_tex/Diss_JohZiegmann.gls

31
01_tex/Diss_JohZiegmann.ist

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
% makeindex style file created by the glossaries package
% for document 'Diss_JohZiegmann' on 2019-10-1
actual '?'
encap '|'
level '!'
quote '"'
keyword "\\glossaryentry"
preamble "\\glossarysection[\\glossarytoctitle]{\\glossarytitle}\\glossarypreamble\n\\begin{theglossary}\\glossaryheader\n"
postamble "\%\n\\end{theglossary}\\glossarypostamble\n"
group_skip "\\glsgroupskip\n"
item_0 "\%\n"
item_1 "\%\n"
item_2 "\%\n"
item_01 "\%\n"
item_x1 "\\relax \\glsresetentrylist\n"
item_12 "\%\n"
item_x2 "\\relax \\glsresetentrylist\n"
delim_0 "\{\\glossaryentrynumbers\{\\relax "
delim_1 "\{\\glossaryentrynumbers\{\\relax "
delim_2 "\{\\glossaryentrynumbers\{\\relax "
delim_t "\}\}"
delim_n "\\delimN "
delim_r "\\delimR "
headings_flag 1
heading_prefix "\\glsgroupheading\{"
heading_suffix "\}\\relax \\glsresetentrylist "
symhead_positive "glssymbols"
numhead_positive "glsnumbers"
page_compositor "."
suffix_2p ""
suffix_3p ""

17
01_tex/Diss_JohZiegmann.lof

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax
\babel@toc {english}{}
\babel@toc {english}{}
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\contentsline {figure}{\numberline {\relax 7.2}{\ignorespaces Polynominterpolynom und Runge-Ph\IeC {\"a}nomen}}{25}{figure.caption.18}%
\contentsline {figure}{\numberline {\relax 7.1}{\ignorespaces Testplot\relax }}{25}{figure.caption.17}%
\contentsline {figure}{\numberline {\relax 7.3}{\ignorespaces Basisfunktionen eines B-Splines}}{26}{figure.caption.19}%
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\contentsfinish

15
01_tex/Diss_JohZiegmann.lot

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax
\babel@toc {english}{}
\babel@toc {english}{}
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\contentsline {table}{\numberline {\relax 7.1}{\ignorespaces Bla Bla\relax }}{24}{table.caption.16}%
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\contentsfinish

0
01_tex/Diss_JohZiegmann.out

BIN
01_tex/Diss_JohZiegmann.pdf

Binary file not shown.

88
01_tex/Diss_JohZiegmann.run.xml

@ -0,0 +1,88 @@ @@ -0,0 +1,88 @@
<?xml version="1.0" standalone="yes"?>
<!-- logreq request file -->
<!-- logreq version 1.0 / dtd version 1.0 -->
<!-- Do not edit this file! -->
<!DOCTYPE requests [
<!ELEMENT requests (internal | external)*>
<!ELEMENT internal (generic, (provides | requires)*)>
<!ELEMENT external (generic, cmdline?, input?, output?, (provides | requires)*)>
<!ELEMENT cmdline (binary, (option | infile | outfile)*)>
<!ELEMENT input (file)+>
<!ELEMENT output (file)+>
<!ELEMENT provides (file)+>
<!ELEMENT requires (file)+>
<!ELEMENT generic (#PCDATA)>
<!ELEMENT binary (#PCDATA)>
<!ELEMENT option (#PCDATA)>
<!ELEMENT infile (#PCDATA)>
<!ELEMENT outfile (#PCDATA)>
<!ELEMENT file (#PCDATA)>
<!ATTLIST requests
version CDATA #REQUIRED
>
<!ATTLIST internal
package CDATA #REQUIRED
priority (9) #REQUIRED
active (0 | 1) #REQUIRED
>
<!ATTLIST external
package CDATA #REQUIRED
priority (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8) #REQUIRED
active (0 | 1) #REQUIRED
>
<!ATTLIST provides
type (static | dynamic | editable) #REQUIRED
>
<!ATTLIST requires
type (static | dynamic | editable) #REQUIRED
>
<!ATTLIST file
type CDATA #IMPLIED
>
]>
<requests version="1.0">
<internal package="biblatex" priority="9" active="0">
<generic>latex</generic>
<provides type="dynamic">
<file>Diss_JohZiegmann.bcf</file>
</provides>
<requires type="dynamic">
<file>Diss_JohZiegmann.bbl</file>
</requires>
<requires type="static">
<file>blx-dm.def</file>
<file>blx-compat.def</file>
<file>biblatex.def</file>
<file>standard.bbx</file>
<file>numeric.bbx</file>
<file>numeric-comp.bbx</file>
<file>ieee.bbx</file>
<file>numeric-comp.cbx</file>
<file>ieee.cbx</file>
<file>biblatex.cfg</file>
<file>english.lbx</file>
</requires>
</internal>
<external package="biblatex" priority="5" active="0">
<generic>biber</generic>
<cmdline>
<binary>biber</binary>
<infile>Diss_JohZiegmann</infile>
</cmdline>
<input>
<file>Diss_JohZiegmann.bcf</file>
</input>
<output>
<file>Diss_JohZiegmann.bbl</file>
</output>
<provides type="dynamic">
<file>Diss_JohZiegmann.bbl</file>
</provides>
<requires type="dynamic">
<file>Diss_JohZiegmann.bcf</file>
</requires>
<requires type="editable">
<file>mybib.bib</file>
</requires>
</external>
</requests>

4
01_tex/Diss_JohZiegmann.sbl

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
\glossaryentry{F?\glossentry{sy:F}|setentrycounter[]{page}\glsnumberformat}{xiv}
\glossaryentry{X?\glossentry{sy:X}|setentrycounter[]{page}\glsnumberformat}{xiv}
\glossaryentry{F?\glossentry{sy:F}|setentrycounter[]{page}\glsnumberformat}{xvi}
\glossaryentry{X?\glossentry{sy:X}|setentrycounter[]{page}\glsnumberformat}{xvi}

11
01_tex/Diss_JohZiegmann.sym

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble
\begin{theglossary}\glossaryheader
\glsgroupheading{F}\relax \glsresetentrylist %
\glossentry{sy:F}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{xiv}\delimN
\setentrycounter[]{page}\glsnumberformat{xvi}}}\glsgroupskip
\glsgroupheading{X}\relax \glsresetentrylist %
\glossentry{sy:X}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{xiv}\delimN
\setentrycounter[]{page}\glsnumberformat{xvi}}}%
\end{theglossary}\glossarypostamble

85019
01_tex/Diss_JohZiegmann.synctex

File diff suppressed because it is too large Load Diff

12
01_tex/Diss_JohZiegmann.tcp

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
[FormatInfo]
Type=TeXnicCenterProjectInformation
Version=4
[ProjectInfo]
MainFile=Diss_JohZiegmann.tex
UseBibTeX=1
UseMakeIndex=1
ActiveProfile=LaTeX ⇨ PDF (Diss) all
ProjectLanguage=en
ProjectDialect=US

162
01_tex/Diss_JohZiegmann.tex

@ -0,0 +1,162 @@ @@ -0,0 +1,162 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ELS PHD Thesis
% Version 1.0 (31.01.2019)
% created by Johannes Ziegmann
% mail: Johannes.Ziegmann@gmail.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt,
a4paper,
twoside, % oneside, twoside
% parskip=half, % put space between paragraphs, and at the same time remove the indentation
parskip=false,
titlepage,
openright, % Chapter immer ungerade (odd) seiten
chapterprefix=true, % Chapter 1 ... dann Überschrift
% toc = listofnumbered,
numbers=noenddot, % p= ointlessnumbers
% ngerman % language setting; default: nothing
]{scrbook} % report, scrreprt, scrbook
% change headers to roman font
\addtokomafont{disposition}{\rmfamily}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%include extra definitions, e.g. added packages, own commands, ...
\input{inputs/packages} % packages
\input{inputs/rgb_colors} % rgb colors
\input{inputs/macros} % macros
\input{inputs/acros} % loading ... input/acros + input/syms
\input{inputs/page_style}
%\usepackage{mathpazo} % switch the roman font to Palatino
%\usepackage{newpxtext,newpxmath} % switch to Palatino, alternative package
\graphicspath{{figures/}} % {logos/}}
\addbibresource{mybib.bib} % only with biblatex
\newcounter{savepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\includeonly{
%chapters/a01_titlepage,
%chapters/a02_preamble,
%chapters/a03_abstract,
%chapters/b01_symbols,
%chapters/b02_acronyms,
%chapters/ch01_introduction,
%chapters/ch02_xxx,
%chapters/ch03_xxx,
%chapters/ch04_xxx,
%chapters/ch05_xxx,
%chapters/ch06_conclusion,
%%chapters/chapter_stuff,
%chapters/d01_appendix
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\selectlanguage{english}
\setcounter{page}{1}
\pagenumbering{roman}
% \shorthandoff{"} % very tricky: disable manipulation of the double quote by babel to retain the possibility to quote file paths for tikz
%\pagestyle{empty} % switch to empty headers etc. for the first pages
\packagesHeadFootStart
\include{chapters/a01_titlepage}
% optional: preamble and acknowledgments
\include{chapters/a02_preamble}
% abstract (english and german)
\include{chapters/a03_abstract}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\pagestyle{fancy} % now enable the fancy headers etc.
% overview of content
\pdfbookmark{\contentsname}{toc} % uncomment for hyperref; adds the TOC to pdf bookmarks, but not to the TOC
\tableofcontents
\cleardoublepage
\phantomsection %uncomment for hyperref
\addcontentsline{toc}{chapter}{\listfigurename} %to show in table of contents
\listoffigures
\cleardoublepage
\phantomsection %uncomment for hyperref
\addcontentsline{toc}{chapter}{\listtablename} %to show in table of contents
\listoftables
% list of symbols:
%\cleardoublepage
\phantomsection %uncomment for hyperref
%%\addcontentsline{toc}{chapter}{Symbols} %to show in table of contents
\include{chapters/b01_symbols}
% list of acronyms:
%\cleardoublepage
\phantomsection %uncomment for hyperref
%%\addcontentsline{toc}{chapter}{Acronyms} %to show in table of contents
\include{chapters/b02_acronyms}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
\setcounter{savepage}{\arabic{page}}
\pagenumbering{arabic}
% set chapter counter back to 1
%\setcounter{chapter}{0} %reset chapter counter
%\renewcommand{\thechapter}{\arabic{chapter}}
\packagesHeadFootMain
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% content
\setstretch{1.2} % Line spacing (AS: 1.3)
\include{chapters/ch01_introduction}
\include{chapters/ch02_xxx}
\include{chapters/ch03_xxx}
\include{chapters/ch04_xxx}
\include{chapters/ch05_xxx}
\include{chapters/ch06_conclusion}
\include{chapters/chapter_stuff}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% appendix
\packagesHeadFootEnde
\appendix
\include{chapters/d01_appendix}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
% Page numbering
\pagenumbering{Roman}
\setcounter{page}{\thesavepage}
\phantomsection %uncomment for hyperref
\addcontentsline{toc}{chapter}{Bibliography}
% bibliography with biblatex:
\packagesHeadFootBib
\vspace{\stretch{1}}
\printbibliography
% bibliography with bibtex:
%\bibliographystyle{IEEEtranS}
%\bibliography{mybib}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

99
01_tex/Diss_JohZiegmann.toc

@ -0,0 +1,99 @@ @@ -0,0 +1,99 @@
\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax
\babel@toc {english}{}
\babel@toc {english}{}
\contentsline {chapter}{List of Figures}{xi}{section*.5}%
\contentsline {chapter}{List of Tables}{xiii}{section*.7}%
\contentsline {chapter}{Notational Conventions}{xv}{section*.10}%
\contentsline {chapter}{Acronyms and Abbreviations}{xvii}{section*.13}%
\contentsline {chapter}{\numberline {1}Introduction}{1}{chapter.1}%
\contentsline {section}{\numberline {1.1}Context and motivation}{1}{section.1.1}%
\contentsline {section}{\numberline {1.2}Survey of related work}{2}{section.1.2}%
\contentsline {section}{\numberline {1.3}Research objectives and thesis outline}{2}{section.1.3}%
\contentsline {chapter}{\numberline {2}Background / Theory}{3}{chapter.2}%
\contentsline {section}{\numberline {2.1}The Bayesian Framework}{3}{section.2.1}%
\contentsline {subsection}{\numberline {2.1.1}Modeling via Exchangeability}{3}{subsection.2.1.1}%
\contentsline {section}{\numberline {2.2}Exponential Families}{7}{section.2.2}%
\contentsline {subsection}{\numberline {2.2.1}Properties of the Canonical Exponential Family}{9}{subsection.2.2.1}%
\contentsline {subsection}{\numberline {2.2.2}Interpretation as Linearly Constrained Maximum Entropy Distribution}{9}{subsection.2.2.2}%
\contentsline {subsection}{\numberline {2.2.3}Examples}{9}{subsection.2.2.3}%
\contentsline {section}{\numberline {2.3}Sufficient Statistics}{9}{section.2.3}%
\contentsline {section}{\numberline {2.4}Incorporating Prior Knowledge}{11}{section.2.4}%
\contentsline {subsection}{\numberline {2.4.1}Conjugate Priors}{11}{subsection.2.4.1}%
\contentsline {subsection}{\numberline {2.4.2}Multinomial Observations}{11}{subsection.2.4.2}%
\contentsline {subsection}{\numberline {2.4.3}Gaussian Observations}{11}{subsection.2.4.3}%
\contentsline {subsection}{\numberline {2.4.4}Multivariate Linear Regression Model}{11}{subsection.2.4.4}%
\contentsline {section}{\numberline {2.5}Graphical Models}{11}{section.2.5}%
\contentsline {subsection}{\numberline {2.5.1}A Brief Overview}{11}{subsection.2.5.1}%
\contentsline {subsection}{\numberline {2.5.2}Directed Graphical Models}{11}{subsection.2.5.2}%
\contentsline {subsection}{\numberline {2.5.3}Undirected Graphical Models}{11}{subsection.2.5.3}%
\contentsline {subsection}{\numberline {2.5.4}Belief Propagation}{11}{subsection.2.5.4}%
\contentsline {section}{\numberline {2.6}Hidden Markov Model}{11}{section.2.6}%
\contentsline {subsection}{\numberline {2.6.1}Forward-Backward Algorithm}{11}{subsection.2.6.1}%
\contentsline {subsection}{\numberline {2.6.2}Viterbi Algorithm}{11}{subsection.2.6.2}%
\contentsline {section}{\numberline {2.7}State Space Models}{11}{section.2.7}%
\contentsline {subsection}{\numberline {2.7.1}Standard Discrete-Time Linear-Gaussian State Space Formulation}{11}{subsection.2.7.1}%
\contentsline {subsection}{\numberline {2.7.2}Vector Autoregressive Processes}{11}{subsection.2.7.2}%
\contentsline {subsection}{\numberline {2.7.3}Switching Linear Dynamic Systems}{11}{subsection.2.7.3}%
\contentsline {subsection}{\numberline {2.7.4}Stochastic Realization Theory}{11}{subsection.2.7.4}%
\contentsline {subsection}{\numberline {2.7.5}Kalman Filtering and Smoothing}{11}{subsection.2.7.5}%
\contentsline {section}{\numberline {2.8}Markov Chain Monte Carlo}{11}{section.2.8}%
\contentsline {subsection}{\numberline {2.8.1}Monte Carlo Integration}{11}{subsection.2.8.1}%
\contentsline {subsection}{\numberline {2.8.2}The Metropolis-Hastings Algorithm}{11}{subsection.2.8.2}%
\contentsline {subsection}{\numberline {2.8.3}Gibbs Sampling}{11}{subsection.2.8.3}%
\contentsline {subsection}{\numberline {2.8.4}Auxiliary, Blocked, and Collapsed Gibbs Samplers}{11}{subsection.2.8.4}%
\contentsline {section}{\numberline {2.9}Bayesian Nonparametric Methods}{11}{section.2.9}%
\contentsline {subsection}{\numberline {2.9.1}Dirichlet Processes}{11}{subsection.2.9.1}%
\contentsline {subsection}{\numberline {2.9.2}Dirichlet Process Mixture Models}{11}{subsection.2.9.2}%
\contentsline {subsection}{\numberline {2.9.3}Hierarchical Dirichlet Processes}{11}{subsection.2.9.3}%
\contentsline {subsection}{\numberline {2.9.4}Beta Process}{11}{subsection.2.9.4}%
\contentsline {chapter}{\numberline {3}Route/Trajectory Prediction}{13}{chapter.3}%
\contentsline {section}{\numberline {3.1}Section}{13}{section.3.1}%
\contentsline {subsection}{\numberline {3.1.1}Subsection}{13}{subsection.3.1.1}%
\contentsline {chapter}{\numberline {4}Prediction of driver influenced parameter (velocity and longitudinal and lateral acceleration)}{15}{chapter.4}%
\contentsline {section}{\numberline {4.1}Section}{15}{section.4.1}%
\contentsline {subsection}{\numberline {4.1.1}Subsection}{15}{subsection.4.1.1}%
\contentsline {chapter}{\numberline {5}Fifth Chapter}{17}{chapter.5}%
\contentsline {section}{\numberline {5.1}Section}{17}{section.5.1}%
\contentsline {subsection}{\numberline {5.1.1}Subsection}{17}{subsection.5.1.1}%
\contentsline {chapter}{\numberline {6}Conclusion}{19}{chapter.6}%
\contentsline {section}{\numberline {6.1}Section}{19}{section.6.1}%
\contentsline {subsection}{\numberline {6.1.1}Subsection}{19}{subsection.6.1.1}%
\contentsline {chapter}{\numberline {7}Test Chapter}{21}{chapter.7}%
\contentsline {section}{\numberline {7.1}ToDo's}{21}{section.7.1}%
\contentsline {section}{\numberline {7.2}Notes}{22}{section.7.2}%
\contentsline {section}{\numberline {7.3}FixMe}{22}{section.7.3}%
\contentsline {section}{\numberline {7.4}Cite}{23}{section.7.4}%
\contentsline {section}{\numberline {7.5}Glossaries}{23}{section.7.5}%
\contentsline {section}{\numberline {7.6}Reference}{23}{section.7.6}%
\contentsline {section}{\numberline {7.7}Macros}{23}{section.7.7}%
\contentsline {subsection}{\numberline {7.7.1}Equations}{23}{subsection.7.7.1}%
\contentsline {subsection}{\numberline {7.7.2}Function}{24}{subsection.7.7.2}%
\contentsline {section}{\numberline {7.8}Table}{24}{section.7.8}%
\contentsline {section}{\numberline {7.9}Figures}{25}{section.7.9}%
\contentsline {chapter}{\numberline {8}Heading on level\xspace 0 (chapter)}{29}{chapter.8}%
\contentsline {section}{\numberline {8.1}Heading on level\xspace 1 (section)}{29}{section.8.1}%
\contentsline {subsection}{\numberline {8.1.1}Heading on level\xspace 2 (subsection)}{29}{subsection.8.1.1}%
\contentsline {subsubsection}{\nonumberline Heading on level\xspace 3 (subsubsection)}{30}{section*.21}%
\contentsline {paragraph}{\nonumberline Heading on level\xspace 4 (paragraph)}{30}{section*.22}%
\contentsline {section}{\numberline {8.2}Lists}{30}{section.8.2}%
\contentsline {subsection}{\numberline {8.2.1}Example for list\xspace (itemize)}{30}{subsection.8.2.1}%
\contentsline {subsubsection}{\nonumberline Example for list\xspace (4*itemize)}{31}{section*.23}%
\contentsline {subsection}{\numberline {8.2.2}Example for list\xspace (enumerate)}{31}{subsection.8.2.2}%
\contentsline {subsubsection}{\nonumberline Example for list\xspace (4*enumerate)}{31}{section*.24}%
\contentsline {subsection}{\numberline {8.2.3}Example for list\xspace (description)}{32}{subsection.8.2.3}%
\contentsline {subsubsection}{\nonumberline Example for list\xspace (4*description)}{32}{section*.25}%
\contentsline {chapter}{\numberline {9}Heading on level\xspace 0 (chapter)}{33}{chapter.9}%
\contentsline {section}{\numberline {9.1}Heading on level\xspace 1 (section)}{33}{section.9.1}%
\contentsline {subsection}{\numberline {9.1.1}Heading on level\xspace 2 (subsection)}{34}{subsection.9.1.1}%
\contentsline {subsubsection}{\nonumberline Heading on level\xspace 3 (subsection)}{36}{section*.26}%
\contentsline {paragraph}{\nonumberline Heading on level\xspace 4 (paragraph)}{37}{section*.27}%
\contentsline {section}{\numberline {9.2}Lists}{38}{section.9.2}%
\contentsline {subsection}{\numberline {9.2.1}Example for list\xspace (itemize)}{38}{subsection.9.2.1}%
\contentsline {subsubsection}{\nonumberline Example for list\xspace (4*itemize)}{39}{section*.28}%
\contentsline {subsection}{\numberline {9.2.2}Example for list\xspace (enumerate)}{42}{subsection.9.2.2}%
\contentsline {subsubsection}{\nonumberline Example for list\xspace (4*enumerate)}{43}{section*.29}%
\contentsline {subsection}{\numberline {9.2.3}Example for list\xspace (description)}{45}{subsection.9.2.3}%
\contentsline {subsubsection}{\nonumberline Example for list\xspace (4*description)}{47}{section*.30}%
\contentsline {chapter}{\numberline {A}Appendix}{55}{appendix.A}%
\contentsline {chapter}{Bibliography}{XIX}{section*.31}%
\contentsfinish

206
01_tex/Diss_JohZiegmann.tps

@ -0,0 +1,206 @@ @@ -0,0 +1,206 @@
[FormatInfo]
Type=TeXnicCenterProjectSessionInformation
Version=2
[Frame0]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=chapters\ch02_xxx.tex
[Frame0_View0,0]
TopLine=272
Cursor=18538
[Frame1]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=inputs\macros.tex
[Frame1_View0,0]
TopLine=184
Cursor=5570
[Frame2]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=Diss_JohZiegmann.tex
[Frame2_View0,0]
TopLine=132
Cursor=4231
[Frame3]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=inputs\acros.tex
[Frame3_View0,0]
TopLine=0
Cursor=289
[Frame4]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=inputs\packages.tex
[Frame4_View0,0]
TopLine=67
Cursor=3680
[Frame5]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=chapters\a03_abstract.tex
[Frame5_View0,0]
TopLine=0
Cursor=558
[Frame6]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=inputs\page_style.tex
[Frame6_View0,0]
TopLine=0
Cursor=481
[Frame7]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=chapters\ch03_xxx.tex
[Frame7_View0,0]
TopLine=66
Cursor=2998
[Frame8]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=chapters\ch04_xxx.tex
[Frame8_View0,0]
TopLine=0
Cursor=103
[Frame9]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=chapters\chapter_stuff.tex
[Frame9_View0,0]
TopLine=313
Cursor=10676
[Frame10]
Flags=0
ShowCmd=1
MinPos.x=-1
MinPos.y=-1
MaxPos.x=-1
MaxPos.y=-1
NormalPos.left=4
NormalPos.top=26
NormalPos.right=1514
NormalPos.bottom=603
Class=LaTeXView
Document=chapters\ch01_introduction.tex
[Frame10_View0,0]
TopLine=0
Cursor=1091
[SessionInfo]
FrameCount=11
ActiveFrame=10

50
01_tex/chapters/a01_titlepage.tex

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
\begin{titlepage}
\thispagestyle{empty}
\vspace*{1.0cm}
%\hfill{\includegraphics[height=10mm]{logos/LOGO}}
\begin{center}
\large {\scshape Universität der Bundeswehr München}\\
Fakultät für Elektrotechnik und Informationstechnik\\[2mm]
\vspace*{2.0cm}
\setlength{\baselineskip}{0.85cm}
\textbf{\LARGE Some Very Important Research}
\vspace*{2cm}
\textbf{\Large Johannes Ziegmann}
\end{center}
\vspace*{0.5cm}
\noindent Vollständiger Abdruck der von der promotionsführenden Einrichtung
Fakultät für Elektrotechnik und Informationstechnik
der Universität der Bundeswehr München zur Erlangung des akademischen Grades eines
\begin{center}
\textbf{Doktors der Ingenieurwissenschaften (Dr.-Ing.)}
\end{center}
genehmigten Dissertation.
\vspace*{2cm}
\noindent
Vorsitzende/-r: \hspace{2pt} \ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\\[10mm]
Prüfende der Dissertation: \\[3mm]
\begin{tabular}{b{25mm} b{100mm}}
\flushright 1. & Prof. Dr.-Ing. Christian Endisch \\[3mm]
\flushright 2. & Prof. Dr.-Ing. habil. Thomas Weyh \\[3mm]
%\flushright 3. & \ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots
\end{tabular}
\vspace*{1cm}
\noindent Die Dissertation wurde am \;\ldots\ldots\ldots\ldots\; bei der
Universität der Bundeswehr München ein\-ge\-reicht und durch die promotionsführende Einrichtung
Fakultät für Elektrotechnik und Informationstechnik am \;\ldots\ldots\ldots\ldots\; angenommen.
\end{titlepage}
\thispagestyle{empty}
\quad
\newpage

10
01_tex/chapters/a02_preamble.tex

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
\section*{Acknowledgments}
Thank you!
%\section*{Acknowledgments}
%
%This work was supported by ...
%
\cleardoublepage

24
01_tex/chapters/a03_abstract.tex

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
% \pdfbookmark[section]{Abstract}{abstract}
\section*{Abstract}
In this work...
\vspace{3cm}
\section*{Kurzfassung}
In dieser Arbeit...
\clearpage
% George Box
% https://en.wikipedia.org/wiki/All_models_are_wrong
\blockquote[George Box (1987)]{
% "Remember that all models are wrong; the practical question is how wrong do they have to be to not be useful."
\ldots all models are approximations. Essentially, all models are wrong, but some are useful. However, the approximate nature of the model must always be borne in mind. \ldots
}
\blockquote[George Box]{The most that can be expected from any model is that it can supply a useful approximation to reality: All models are wrong; some models are useful
}
\cleardoublepage

13
01_tex/chapters/b01_symbols.tex

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
%\chapter*{Symbole\markboth{Symbole}{Symbole}}
\glsaddall
\printglossary[type=symbols,style=long,nogroupskip=true,nopostdot]
% \textfixme{Wahrscheinlichkeitsdichtefunktion $p$}\\
% \textfixme{Wahrscheinlichkeit $P$}
% \glsaddall
% \setlength{\glsdescwidth}{0.5\linewidth}
% \setlength{\glspagelistwidth}{0.1\linewidth}
% \printglossary[type=symbols,title=Symbols]
%

50
01_tex/chapters/b02_acronyms.tex

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
%\chapter*{Abkürzungen\markboth{Abkürzungen}{Abkürzungen}}
%\section*{Acronyms and Abbreviations}
%\input{inputs/acronyms}
\glsaddall
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\printglossary[type=\acronymtype,style=super,title=Acronyms and Abbreviations,nogroupskip=true,nopostdot]
%\printacronyms[include-classes=abk, name={Abkürzungsverzeichnis}]
%
%\begin{acronym}[ARIMA] % put longest acronym in the brackets
% \acro{ANN}{Artificial Neural Network}
% \acro{ADF}{Assumed-Density-Filtering}
% \acro{ARIMA}{Autoregressive Integrated Moving Average}
% \acro{BV}{Bayes-Variationsrechnung}
% \acro{CPU}{Central Processing Unit}
% \acro{DPCA}{Dynamic Principal Component Analysis}
% \acro{DPLS}{Dynamic Partial Least Squares}
% \acro{EFT}{Endfunktionstest}
% \acro{EOL}{End-of-Line}
% \acro{EM}{Expectation-Maximization}
% \acro{EWMA}{Exponentially Weighted Moving Average}
% \acro{FMEA}{Failure Mode and Effects Analysis}
% \acro{GKF}{Gating-Kalman-Filter}
% \acro{HDI}{Highest-Density-Interval}
% \acro{HDR}{Highest-Density-Region}
% \acro{iid}[i.i.d.]{independent and identically distributed}
% \acro{iO}[i.O.]{in Ordnung}
% \acro{IRLS}{Iteratively-Reweighted-Least-Squares}
% \acro{KF}{Kalman-Filter}
% \acro{MAD}{Median Absolute Deviation}
% \acro{MAP}{Maximum-a-posteriori}
% \acro{MCMC}{Markov-Chain-Monte-Carlo}
% \acro{ML}{Maximum-Likelihood}
% \acro{niO}[n.i.O.]{nicht in Ordnung}
% \acro{ORKF}{Robustes Filter auf Basis der Bayes-Variationsrechnung} % Variational-Bayesian-Robust-Kalman-Filter
% \acro{PCA}{Principal Component Analysis}
% \acro{PF}{Particle-Filter}
% \acro{PLS}{Partial Least Squares}
% \acro{RBF}{Radial-Basis-Function}
% \acro{RME}{Rekursiver M-Schätzer}
% \acro{RTS}{Rauch-Tung-Striebel}
% \acro{SPC}{Statistical Process Control}
% \acro{SVDD}{Support Vector Data Description}
% \acro{SVM}{Support Vector Machine}
% \acro{TKF}{Student-t-Kalman-Filter von Roth}
% \acro{Val}[Val.]{Validierung}
%
%\end{acronym}

48
01_tex/chapters/ch01_introduction.tex

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
\chapter{Introduction}
\label{ch:01_introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Context and motivation}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Accurate prediction of the individual driver behavior is essential for various automotive future technologies. Forecasting applications addressing the driver behavior are for instance risk assessment of traffic scenarios for active and passive safety, automated driving, driving route prediction (forscasting) and control functions or energy management and strategies [1]–[3]. With increasing and more accurate information of vehicle and environmental data ensuring precise predictions, advanced driver assistance systems (ADAS) combined with driver models guarantee high reliability.
Using the back end server-side with online data, modern navigation systems provide the ADAS and driver model with a high amount of forecast information of the vehicle environment. Based on the ADAS application, the prediction horizon can be classified into short-range and long-range predictions. The two categories differ mainly in the range of the input data. While short-term predictions affect to the vehicle sensors ranging a few hundreds meters in front of the ego-vehicle motion, long-range prediction uses navigation and road based data approaches minimizing the time dependency in the forecast.
The work focuses on long-range prediction horizons ranging from a few kilometers ahead to the final destination. Automotive applications using the long-range prediction horizon are for instance efficiency systems, which are optimizationstrategies of hybrid electric vehicles (HEVs) and range calculation for battery electric vehicles (BEVs). Thereby the precision of the upcomming power and velocity prediction is instrumental for the overall vehicle power consumption of HEVs and influences the range forecast of BEVs [4].
Focusing the range calculation and energy forecast of BEVs, main influences of predictive energy consumption are given by the vehicle parameters, which are for instance the vehicle mass together with the driving resistance coefficients and the driver depended vehicle dynamics given by the individual driving velocity and its time derivatives [5]. With individual velocity prediction the ADAS can give premature feedback to the driver enabling a satisfactory and reliable systems for the customer.
Long-range prediction of the individual velocity is challenging though, since the probability of the predicted speed occurrence decreases with an increasing prediction horizon [6]. The prediction output quantity is influenced by several uncertain factors, which are for instance traffic jams, time dependent road surfaces and weather conditions. In addition the driver behavior can change over time, which leads to a complex system that is hard to grasp with pure physical relations. To model the driver behavior machine learning algorithms are used. Latest research analyzed neural networks, non-parametric regressions or stochastic prediction models [4], [6]–[9].
While [4], [6], [9] do not take environmental features and [8] does not take the predicted continuous vehicle velocity into account, this approach investigates modeling the driver individual behavior with a stochastic process given the environment. The work examines the modeling procedure in combination with the influences on the driver behavior based on environmental factors, e.g. road curvature. The parameters and distributions of this process are learned based on individual naturalistic driving data. Thereby, linearity and Gaussian distribution assumption for underlying densities that lead to the Kalman Filter and Rauch-Tung-Striebel Smoother algorithms showed to be too limited. The use of non-parametric distributions, making numerical methods like particle-based algorithms essential, showed far more promising results for modeling driver individual velocity behavior.
The stochastic algorithms together with the online traffic speed source and a neural network approach given [7], are evaluated by using 1500 km real world naturalistic driving data. The study data refers to to 39 driving tracks and includes 8 different drivers. On the basis of the data set, a total
of 5 different velocity prediction algorithms are trained and validated. The stochastic models show high accuracy and
precise prediction result. Following the remainder of this paper is organized. In Sec. II, the problem formulation with the modeling procedure
from the driving surrounding to the vehicle dynamic including driver behavior is presented. Additionally conditional stochastic
independence is defined guaranteeing the use of hidden Markov models. Furthermore the database of the study with
a classification method are described. The four stochastic prediction models are explained in Section III, starting with
the linear and Gaussian assumption, Sec. III-A. The nonparametric stochastic model is investigated in Subsection III-B.
Finally, the results of the prediction algorithms are shown in Section IV with the subsequent conclusion in Sec. V.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Survey of related work}
\label{sec:0101_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Research objectives and thesis outline}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

331
01_tex/chapters/ch02_xxx.tex

@ -0,0 +1,331 @@ @@ -0,0 +1,331 @@
\chapter{Background / Theory}
\label{ch:02_xxx}
\lettrine{T}{his} theory chapter reviews statistical methodologies upon which the contributions are based. Section \fixme{xxx} \ldots.
For the models exact inference is considered to be infeasible, leading to Markov chain Monte Carlo techniques that are outlined in Sec. \fixme{xxx}. Finally Sec. \fixme{xxx} concludes the background material ....
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The Bayesian Framework}
\label{sec:0201_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In this section we provide a brief motivation for the Bayesian approach and establish some concepts that reappear throughout this thesis. The overarching goal of the thesis is then to examine the flexibility a Bayesian approach can provide in the case of learning dynamical unknown systems.
\texttodo{Types of probability - classical, frequentist, and Bayesian}
If we compare the so-called frequentist philosophy of statistical analysis to Bayesian inference the difference is that in Bayesian inference the probability of an event does not mean the proportion of the event in an infinite number of trials, but the uncertainty of the event in a single trial. Because models in Bayesian inference are formulated in terms of probability distributions, the probability axioms and computation rules of the probability theory (see, e.g., Shiryaev, 1996) also apply in Bayesian inference.
%==============================================================================
\subsection{Modeling via Exchangeability}
\label{subsec:020101_xxx}
%==============================================================================
The concept of exchangeability is central to many statistical approaches, and may be viewed as critical in motivating Bayesian statistics. Let us assume that we are aggregating data in an attempt to make predictions about future values of the random process we are observing. If we were to make the strong assumption of the data being independent, we would treat every new data point individually without using past observations to predict future observations since:
\begin{align}
\p{y_1,\ldots,y_n} = \prod_{i=1}^{n}{\p{y_i}}
\end{align}
implies that
\begin{align}
\p{y_{n+1},\ldots,y_m|y_1,\ldots,y_n} = \p{y_{n+1},\ldots,y_m}.
\end{align}
A weaker assumption that often better describes the data we encounter is that of exchangeability, which states that the order we encounter the data is inconsequential.
\begin{definition}
A sequence of random variables $y_1,y_2,\ldots,y_n$ is said to be finitely exchangeable if
\begin{align}
y_1,y_2,\ldots,y_n \stackrel{\mathcal{D}}{=} y_{\pi(1)},y_{\pi(2)},\ldots,y_{\pi(n)}
\end{align}
for every permutation $\pi$ on $\{ 1,\ldots,n \}$. Here, we use the notation $\stackrel{\mathcal{D}}{=}$ to mean equality in distribution.
From this definition, we see that independence implies exchangeability, but not vice versa. We are often in settings where data is continually accumulated, or in which fixing an upper bound $n$ is challenging. We would thus like to formalize a notion of
exchangeability for infinite sequences.
\end{definition}
\begin{definition}
A sequence $y_1,y_2,\ldots$ is said to infinitely exchangeable if every finite subsequence is finite exchangeable [15].
As is demonstrated in Bernardo and Smith [15], not every finitely exchangeable sequence can be embedded in an infinitely exchangeable sequence.
\end{definition}
Exchangeability has simplifying implications for inference since we can simply ignore the order in which the data arrive. Sometimes, exchangeability is too strong of an assumption. Relaxations include considering \textit{partially exchangeable} data where some auxiliary information partitions the data into exchangeable sets. For example, consider a person flipping two biased coins, one on even throws and the other on odd throws. The data are exchangeable within the set of odd or even tosses if these labels are provided. There are many possible extensions and variations on the standard exchangeability model; however, the end goal is to group data into exchangeable, and thus relatively simple, blocks for which inference is more tractable.
A very important result arising from the assumption of exchangeable data is what is typically referred to as \textit{de Finetti’s theorem}. This theorem states that an infinite sequence of random variables $y_1,y_2,\ldots,y_n$ is exchangeable if and only if there exists a random probability measure $\nu$ with respect to which $y_1,y_2,\ldots,y_n$ are conditionally \gls{acr:iid} with distribution $\nu$. Furthermore, this random measure can be viewed as the limiting empirical measure. De Finetti actually proved this in the case of binary random variables de Finetti [33], with the more general extension to arbitrary real-valued exchangeable sequences made by Hewitt and Savage [66] and Ryll-Nardzewski [146].
We have seen in Theorem 2.1.1 that for infinitely exchangeable binary sequences, there exists a random probability measure $\nu$ that concentrates on $\{0,1\}$ implying that this measure can be uniquely described by a single parameter $\theta$.
One can straightforwardly extend the argument in Theorem 2.1.1 to infinitely exchangeable sequences taking values in $\{1, \ldots, K\}$; here, the random measure yielding the data \gls{acr:iid} concentrates on $\{1, \ldots,K\}$ and is thus uniquely defined by a $(K-1)$-dimensional parameter $ \theta = \{ \theta_1, \ldots , \theta_{K-1} \}$ [15].
Analogous to the examples presented in Example 2.1.2, possible underlying games include rolling a $K$-sided weighted die or drawing from an urn with $K$ different colored balls.
When moving to infinitely exchangeable sequences taking values in the reals, the random probability measures $\nu$ can be arbitrarily complex and are, in general, defined by infinitely many parameters (i.e., $\nu$ is a generic element of $\mathcal{P}(\R)$.)
Some special cases exist in which the parametrization remains finite. For example, if $\nu$ is almost surely a Gaussian distribution, the parametrization solely consists of a mean and variance.
The more general case in which $\theta$ may be an infinite-dimensional parameter motivates the development of Bayesian nonparametric methods, some of which we explore in this thesis. For example, the Dirichlet process of Sec. \fixme{xxx} defines a distribution on probability measures that concentrate at a countably infinite number of elements of the reals (or the more general spaces we consider in Sec. \fixme{xxx})
When we limit ourselves to the more restrictive class of finite-dimensional $\theta$ (e.g., Bernoulli, multinomial, Gaussian random variables), we can invoke the following corollaries.
\begin{corollary}
Assuming the required densities exist, and assuming the conditions
of Theorem 2.1.2 hold, then there exists a distribution function ${Q}$ such that the joint density of $y_1, \ldots, y_n$ is of the form
\begin{align}
\p{y_1,\ldots,y_n} = \int_\theta{\prod_{t=1}^{n}{\p{y_1|\vartheta}} \, d {Q \left(\vartheta \right)}},
\end{align}
with $\p{\cdot|\vartheta}$ representing the density function corresponding to the finite-dimensional parameter $\vartheta \in \theta$.
\end{corollary}
From the above corollary, it is simple to see how the de Finetti theorem motivates the concept of a prior distribution $Q(\cdot)$ and a likelihood function $\p{y|\cdot}$
\begin{corollary}
Given that the conditions of Corollary 2.1.1 hold, then the predictive density is given by
\begin{align}
\p{y_{m+1},\ldots,y_n|y_1,\ldots,y_m} = \int_{\theta}{\prod_{i=m+1}^{n}{\p{y_i|\vartheta} } \, d Q\left( \vartheta | y_1,\ldots,y_m \right) },
\end{align}
where
\begin{align}
d Q\left( \vartheta | y_1,\ldots,y_m \right) = \frac{\prod_{i=1}^{m}{\p{y_i|\theta} } \, d Q\left(\theta \right)}{\int_{\theta}{\prod_{i=1}^{m}{\p{y_i|\vartheta} } \, d Q\left( \vartheta \right) }}.
\end{align}
\end{corollary}
\textit{Proof.} The result follows directly from employing
\begin{align}
\p{y_{m+1},\ldots,y_n|y_1,\ldots,y_m} = \frac{\p{y_1,\ldots,y_n}}{\p{y_1,\ldots,y_m}},
\end{align}
along with Corollary 2.1.1.
From the form of the predictive density in Eq. (2.10), we see that our view of the existence of an underlying random parameter $\theta$ yielding the data \gls{acr:iid} has not changed. Instead, we have simply updated our prior belief $Q\left(\theta\right)$ into a posterior belief $Q\left(\theta|y_1,\ldots,y_m\right)$ through an application of Bayes rule:
\begin{align}
\p{\theta|y} &= \frac{\p{y|\theta}\p{\theta}}{\int_\theta{\p{y|\vartheta}\p{\vartheta} d \vartheta}}\\
&= \frac{\p{y|\theta}\p{\theta}}{\p{y}}
\end{align}
Here, we have written the rule in its simplest form assuming that a density on $\theta$ exists in addition to the conditional density on $y$. Although one can view the computation of the predictive distribution in Eq. (2.10) as the objective in Bayesian statistics, we will often limit our discussion to the process of forming the posterior distribution in Eq. (2.11) from the prior by incorporating observations, since this is a fundamental step
in examining the predictive distribution.
From a practical perspective, we never have an infinite sequence of observations from which to characterize our prior distribution. Furthermore, even if we had such a quantity, the probability measure that the de Finetti theorem would suggest as yielding the data \gls{acr:iid} might be arbitrarily complex. Thus, we are left with two competing pragmatic choices in defining our prior:
\begin{enumerate}
\item Tractable inference,
\item Modeling flexibility.
\end{enumerate}
The issue of tractable inference often motivates the use of conjugate priors, as discussed in Sec. \fixme{xxx}. The goal of flexibility in our models leads to the study of Bayesian nonparametric methods. A brief introduction to some specific classes of nonparametric methods that maintain computational tractability is presented in Sec. \fixme{xxx}.
Another key aspect of the Bayesian framework we have established is in characterizing a model, or likelihood distribution, $\p{y|\theta}$ for how our data are generated conditioned a parameter value $\theta$. This choice, too, is often motivated by practical considerations that are typically coupled with those of choosing a prior distribution. We do not develop a full analysis of model selection in this thesis, but begin the exploration in Sec. \fixme{xxx}.
\textbf{
As practitioners, we do not actually know the underlying generative
process, but we can use a combination of our insight on the process (e.g., we know we are observing heights from a given population and heights tend to be well-modeled as Gaussian) and our adherence to computational limitations to define a model.
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Exponential Families}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Exponential families represent a fundamental class of distributions in statistics. They arise as the answer to numerous, albeit related, questions.
Within the Bayesian framework:
For what class of models does there exist a prior that leads to computationally tractable inference [15, 141]?
Frequentists arrive at the exponential family when asking:
If there exists an efficient estimator, can we describe the class of models from which the data could have been generated [87, 184]?
Common to both domains:
What distribution is maximally random while being consistent with a set of moment constraints [15, 79, 116]?
\begin{definition}
A parametrized family of distributions $\mathcal{P}_\theta = \{P_\theta\}$ is a $k$-parameter exponential family with natural parameter $\mv{\eta}(\cdot)=\left[\eta_1(\cdot),\ldots,\eta_k(\cdot) \right]^\top$ natural statistic $\mv{t}(\cdot)=\left[t_1(\cdot),\ldots,t_k(\cdot) \right]^\top$, and base distribution $\p{\cdot} \propto e^{\beta(\cdot)}$ if each member $P_\theta$ of the family has a density of the form
\end{definition}
\begin{align}
\p{\mv{y}|\mv{\theta}} &= \exp{\left\{\mv{\eta}^\top (\mv{\theta})\mv{t}(\mv{y}) - {\alpha}(\mv{\theta}) + \beta(\mv{y}) \right\}}\\
&= \exp{\left\{\sum_{i=1}^k{\eta_i (\mv{\theta}){t_i}(\mv{y}) - {\alpha}(\mv{\theta}) + \beta(\mv{y}) } \right\} }
\end{align}
with respect to a dominating measure\footnote{The dominating measure is the assumed measure on the considered measurable space, and as such provides the measure with respect to which the Radon-Nikodym derivative is taken when defining densities (amongst other measure-theoretic operations one could examine).} $\mu$. Here, $y$\footnote{We use the notation $\mv{y}$ rather than $y$ to indicate that this quantity is allowed to be vector valued.} is a point in the sample space $\mathcal{Y}$, which represents the support of the density. The function $\alpha(\cdot)$ is referred to as the
log-partition function and ensures that the probability density integrates to $1$. We will denote this family by $\mv{\epsilon}\left( \mv{\theta}; \mv{\nu}(\cdot), \mv{t}(\cdot), \beta(\cdot) \right)$.
The set of admissible parameter values, or the natural parameter space, for which a constant $\alpha(\mv{\theta})$ exists are those such that
\begin{align}
\int{\exp{\left\{\sum_{i=1}^k{\eta_i (\mv{\theta}){t_i}(\mv{y}) - {\alpha}(\mv{\theta}) + \beta(\mv{y}) } \right\} }} dy < \infty
\end{align}
We could generalize Eq. (2.15) and the results to follow for a given measure $\mu$ rather than the assumed Lebesgue (or where appropriate, counting) measure. However, we will omit this level of mathematical formality.
It is common to restrict oneself to examining families of distributions whose support, i.e., the set of $y$ such that $\p{\mv{y}|\mv{\theta}}>0$, does not depend upon $\mv{\theta}$.
\begin{definition}
An exponential family $\mv{\epsilon}\left( \mv{\theta}; \mv{\nu}(\cdot), \mv{t}(\cdot), \beta(\cdot) \right)$ is called regular if the support of each member of the family does not depend upon the value of the parameter $\mv{ \theta}$.
\end{definition}
Another form of exponentail families that deserves a special name is when the density eof each member of the family depends linearly on the parameters, i.e., $\mv{ \nu}(\theta)=[\theta_1,\ldots,\theta_k]$.
\begin{definition}
A canonical esponetial family is one which depends linearly on the parameter $\mv{ \theta}$:
\begin{align}
\p{\mv{y}|\mv{ \theta}} &= \exp{ \left\{ \mv{\theta}^\top \mv{t} -\alpha(\mv{ \theta}) + \beta(\mv{y}) \right\} }\\
&= \exp{ \left\{ \sum_{i=1}^{^k}{ \theta_i t_i (\mv{y})} -\alpha(\mv{ \theta}) + \beta(\mv{y}) \right\} }.
\end{align}
We will denote the canonical exponential family by $\mv{\epsilon}\left( \mv{\theta}; \mv{\oneM}(\cdot), \mv{t}(\cdot), \beta(\cdot) \right)$
\end{definition}
One, in theory, can describe the canonical exp. family form by defining a family $\mathcal{P}_\eta$ with the parameters as the possibly nonlinear mapping $\ldots$. In practice, it might be challengig to find the set of admissible values of $\mv{ \eta}$ and the form of the log-partition function. Note that some references, such as Bernardo and Smith [15], use the term \textit{canonical} to refer to esp. families that also depend linearly on the data.
\begin{definition}
For data $\mv{y}$ distributed according to $\p{\mv{y} | \mv{ \theta}}$, a parameter $\mv{\theta}$ is termed unidentifiable on the basis of $\mv{y}$ if there exists $ \mv{ \theta}_1 \neq \mv{ \theta}_2$ such that $\mv{P}_{ \theta_1} = \mv{P}_{ \theta_2}$.
\end{definition}
%==============================================================================
\subsection{Properties of the Canonical Exponential Family}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Interpretation as Linearly Constrained Maximum Entropy Distribution}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Examples}
\label{subsec:xxx}
%==============================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Sufficient Statistics}
\label{sec:xxx}
For the exponential family, we have seen that the densities only depend on the data through the natural statistics $\mv{t}(\mv{y})$ and the base distributions $q(\mv{y}) \propto \exp{ \{ \beta(\mv{y}) \} }$.
This leads one to ask under what conditions are inferences using transformations of the data, or \textit{statistics}, the same as if we had used the data itself. One might additionally ask what set of models yield a compact set of statistics, summarizing an arbitrarily large set of data, that are sufficient for the inferences we wish to make. In the following, we establish a formal framework for this data-processing concept.
\begin{definition}
Given a sequence of random variables $\mv{y}_1,\mv{y}_2,\ldots,$ with $\mv{y}_j \in \mathcal{Y}_j$ and probability measure $P$, a sequence of statistics $\mv{t}_1,\mv{t}_2,\ldots,$ with each function $\mv{t}_j$ defined on the product space $\mathcal{Y}_1 \times \cdots \times \mathcal{Y}_j$, is said to be predictive sufficient for $\mv{y}_1,\mv{y}_2,\ldots$ if
\begin{align}
\p{\mv{y}_{i_1},\ldots,\mv{y}_{i_k} | \mv{y}_1,\ldots,\mv{y}_j} = \p{\mv{y}_{i_1},\ldots,\mv{y}_{i_k} | \mv{t}_j} \qquad \forall j,k
\end{align}
where $\{i_1,\ldots,i_k\}$ are a set of indices not seen in $\{1,\ldots,j\}$. Here, $\p{\cdot|\cdot}$ is the conditional density induced by the measure $P$.
\end{definition}
That is, given $\mv{t}_j = \mv{t}_j(\mv{y}_1,\ldots,\mv{y}_j)$, the values of the data $\mv{y}_1,\ldots,\mv{y}_j$ do not further contribute to the prediction of future values of data.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Incorporating Prior Knowledge}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Conjugate Priors}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Multinomial Observations}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Gaussian Observations}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Multivariate Linear Regression Model}
\label{subsec:xxx}
%==============================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Graphical Models}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{A Brief Overview}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Directed Graphical Models}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Undirected Graphical Models}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Belief Propagation}
\label{subsec:xxx}
%==============================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Hidden Markov Model}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Forward-Backward Algorithm}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Viterbi Algorithm}
\label{subsec:xxx}
%==============================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{State Space Models}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Standard Discrete-Time Linear-Gaussian State Space Formulation}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Vector Autoregressive Processes}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Switching Linear Dynamic Systems}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Stochastic Realization Theory}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Kalman Filtering and Smoothing}
\label{subsec:xxx}
%==============================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Markov Chain Monte Carlo}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Monte Carlo Integration}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{The Metropolis-Hastings Algorithm}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Gibbs Sampling}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Auxiliary, Blocked, and Collapsed Gibbs Samplers}
\label{subsec:xxx}
%==============================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Bayesian Nonparametric Methods}
\label{sec:xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Dirichlet Processes}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Dirichlet Process Mixture Models}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Hierarchical Dirichlet Processes}
\label{subsec:xxx}
%==============================================================================
%==============================================================================
\subsection{Beta Process}
\label{subsec:xxx}
%==============================================================================

107
01_tex/chapters/ch03_xxx.tex

@ -0,0 +1,107 @@ @@ -0,0 +1,107 @@
\chapter{Route/Trajectory Prediction}
\label{ch:03_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Section}
\label{sec:0301_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[H]
\centering
\tikz{ %
%Define nodes
\node[obs] (x) {$\mv{x}_n^{(j)}$};
\node[latent, above=of x] (s) {$s_n^{(j)}$};
\node[latent, left=of s] (s0) {$s_0$};
\node[latent, left=of s0] (pi) {$\mv{\pi}_{\mv{i}}$};
\node[latent, below=of pi] (theta) {$\theta_{\mv{i}}$};
\node[latent, left=of pi] (alpha) {$\alpha$};
\node[latent, left=of theta] (H) {$H$};
\node[latent, left=of H] (lambda) {$\lambda$};
\node[latent, above=of pi] (beta) {$\beta$};
\node[latent, left=of beta] (gamma) {$\gamma$};
\node[latent, above=of s] (z) {$z^{(j)}$};
\node[latent, right=of z] (rho) {$\rho$};
\node[latent, right=of rho] (eta) {$\eta$};
\node[const, left=of gamma,yshift=0.25cm] (gamma_a) {$\gamma_a$};
\node[const, left=of gamma,yshift=-0.25cm] (gamma_b) {$\gamma_b$};
\node[const, left=of alpha,yshift=0.25cm] (alpha_a) {$\alpha_a$};
\node[const, left=of alpha,yshift=-0.25cm] (alpha_b) {$\alpha_b$};
\edge {gamma_a} {gamma};
\edge {gamma_b} {gamma};
\edge {alpha_a} {alpha};
\edge {alpha_b} {alpha};
\factor[left=of eta] {eta_rho} {GEM()} {} {} ; %
\factor[left=of rho] {rho_z} {Cat()} {} {} ;
\factor[right=of gamma] {gamma_beta} {GEM()} {} {} ; %
\factor[above=of x] {x_s} {right:$F(\theta_{s_n^{(j)}})$} {} {} ; %
\factor[left=of H] {lambda_H} {NIW} {} {} ; %
%\factor[above=of f,yshift=0.7cm] {rf} {Cat} {} {} ;
%\factor[above=of pi, yshift=0.4cm] {pi-f} {left:Dir} {} {} ;
%\factor[above=of t, yshift=0.5cm] {t-f} {left:Beta} {} {} ; %
%\factor[right=of p, xshift=0.5cm] {p-f} {Dir} {} {} ; %
%\factor[above=of d, yshift=0.4cm] {d-f} {right:Dir} {} {} ; %
%Connect the nodes
\edge {s0} {s} ;
\edge {s} {x} ;
\edge {z} {s} ;
\edge {rho} {z} ;
\edge {eta} {rho} ;
\edge {lambda} {H} ;
\edge {H} {theta} ;
\edge {alpha} {pi} ;
\edge {beta} {pi} ;
\edge {gamma} {beta} ;
%\edge {pi} {s} ;
\path (pi) edge [bend left,->] (s) ;
%\path (theta) edge [bend left,->] (x) ;
\edge {theta} {x} ;
%\factoredge {gamma} {d-f} {d} ;
%\factoredge {alpha} {p-f} {p}; %
%\factoredge {p} {t-f} {t}; %
%\factoredge {beta} {pi-f} {pi} ;
%\factoredge {pi} {yf} {y} ;
%\factoredge {d} {rf} {f} ;
%\gate {y-gate} {(yf)(yf-caption)} {t}
%\gate {f-gate} {(rf)(rf-caption)} {t}
%Plates
\plate [inner sep=0.25cm,xshift=1.2mm,yshift=0.15cm] {sx} {(s)(x)} {$N_j$}; %
{\tikzset{plate caption/.append style={above=-1.2cm of #1.south east }}
\plate [inner sep=0.45cm,yshift=0.4cm] {sxz} {(s)(x)(z)} {$J$};}
\plate [inner sep=0.35cm, color=black,
fill=black,
fill opacity=0.1,
text opacity=1] {pitheta} {(pi)(theta)} {$\infty$};
\node[latent, left=of s0,fill=white] (pi) {$\mv{\pi}_{\mv{i}}$};
\node[latent, below=of pi,fill=white] (theta) {$\theta_{\mv{i}}$};
%{\tikzset{plate caption/.append style={above=5pt of #1.north west}} ... }
%{\tikzset{plate caption/.append style={above=5pt of #1.north east}} ... }
%{\tikzset{plate caption/.append style={above=5pt of #1.south west}}
%\plate [inner sep=0.2cm, xshift=-0.2cm, color=red] {pM} {(beta)(pi)(yf)(y)(rf)(f)} {M workers} ;}
%\plate [inner sep=0.2cm, xshift=-0.05cm, yshift=0.15cm, color=brown] {pJi} {(y)(f)} {$J_i$}
}
\end{figure}
\begin{align}
\mv{i} = [l,k]
\end{align}
$l$ represents the l'th HMM (e.g. for trajectory classification) and state $k$ respectively.
%==============================================================================
\subsection{Subsection}
\label{subsec:030101_xxx}
%==============================================================================

13
01_tex/chapters/ch04_xxx.tex

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
\chapter{Prediction of driver influenced parameter (velocity and longitudinal and lateral acceleration)}
\label{ch:04_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Section}
\label{sec:0401_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Subsection}
\label{subsec:040101_xxx}
%==============================================================================

13
01_tex/chapters/ch05_xxx.tex

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
\chapter{Fifth Chapter}
\label{ch:05_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Section}
\label{sec:0501_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Subsection}
\label{subsec:050101_xxx}
%==============================================================================

13
01_tex/chapters/ch06_conclusion.tex

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
\chapter{Conclusion}
\label{ch:06_conclusion}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Section}
\label{sec:0601_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Subsection}
\label{subsec:060101_xxx}
%==============================================================================

766
01_tex/chapters/chapter_EOL.tex

@ -0,0 +1,766 @@ @@ -0,0 +1,766 @@
\chapter{\ac{EOL}-Prüftechnik für Fahrzeugmotoren}
\label{ch:EOL}
Die \ac{EOL}-Prüftechnik in der Großserienproduktion von Fahrzeug-Verbrennungsmotoren dient in den nachfolgenden Kapiteln als Anwendungsbeispiel für die untersuchten lernfähigen Prüfverfahren.
Dieses Kapitel beschreibt deshalb zunächst die Grundlagen der \ac{EOL}-Prüfung in dieser Anwendung. Ziel ist die Einordnung der \ac{EOL}-Prüfung in den Herstellungsprozess und die Darstellung der Abläufe im Prüfvorgang, soweit diese für die nachfolgende Untersuchung von Prüfalgorithmen relevant sind. Darauf aufbauend lassen sich die Rahmenbedingungen für den Einsatz lernfähiger Algorithmen darstellen.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Einordnung der \ac{EOL}-Prüfung in den Herstellungsprozess}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Die Motormontage weist einen relativ großen Anteil manueller Tätigkeiten auf, die entsprechend fehleranfällig sind und daher gegen Fehler abgesichert werden müssen um eine einwandfreie Produktqualität sicherstellen zu können. %\textfixme{Quelle für Anteil manuell, evtl. im Vergleich zu ..., und Fehleranfälligkeit manueller Tätigkeiten}
Neben der vorausschauenden Fehlervermeidung z.B. durch \ac{FMEA} oder Poka-Yoke \cite[][264]{Hering2003} erfolgt daher in der Motormontage sowohl die Überprüfung von einzelnen Montageschritten als auch des Endproduktes. Die in den Montageprozess integrierte Prüfung von teilmontierten Produkten ermöglicht es, auftretende Fehler nahe an deren Quelle zu erkennen. Dadurch ist die Fehlerbehebung möglich ohne nachfolgende Montageschritte rückgängig machen zu müssen \cite[][4]{Hametner2001}. Beispielhafte Prüfungen innerhalb der Montage von Verbrennungsmotoren sind:
\begin{itemize}
\item Drehmomentprüfung nach Einlegen des Kurbeltriebes in das Kurbelgehäuse inkl. Vorbeölung \cite[][2]{Hametner2001},
\item Dichtheitsprüfung für die Radialwellendichtringe \cite[][2]{Hametner2001},
\item Dichtheitsprüfung (Lecktest) für Ölraum, Wasserraum, Ansaugsystem, Auslasssystem und Kraftstoffsystem \cite[][2,4]{Hametner2001}, \cite[][21]{Brummet2006},
\item Optische Prüfung auf den korrekten und vollständigen Verbau von Bauteilen, z.B. bei Kolben \cite{Sagerer1997}.
\end{itemize}
%\texttodo{Bild Prüftechnik in Motormontage wie [Wiederer2015, p. 19]?}
Die \ac{EOL}-Prüfung ist naturgemäß nahe am Ende des Herstellungsprozesses positioniert, um so viele Arbeitsschritte wie möglich in der Prüfung zu erfassen.
Konkret wird die \ac{EOL}-Prüfung von Verbrennungsmotoren heute bevorzugt als Kalttest ausgeführt, bei dem eine E-Maschine den Prüfling elektrisch schleppt ohne dass dieser Kraftstoff verbrennt \cite{Sagerer1997}. Typisch ist dabei eine \SI{100}{\percent}-Prüfung aller produzierten Motoren \cite[][4]{Brummet2006}.
Die früher üblichen Heißtestprüfstände mit aktivem Betrieb des Prüflings haben heute eine reduzierte Bedeutung \cite[][VIII]{Hametner2001}, \cite[][79]{Martyr2012}. Typischerweise durchlaufen weniger als $\SI{10}{\percent}$ der produzierten Motoren einen Heißtest \cite[][18]{Brummet2006}. Die Dauer des eigentlichen Prüflaufs im Heißtest beträgt wenige Minuten (z.B. \num{2.5} Minuten bei Brummet \cite[][17]{Brummet2006}). Der gesamte Prüfvorgang im Heißtest inkl. Herstellen und Trennen der Verbindung von Prüfling und Prüfstand dauert lt. Martyr fünf bis acht Minuten \cite[][78]{Martyr2012}, bei Delvecchio mehr als zehn Minuten \cite{Delvecchio2007}.
Parallel erfolgen Prüfungen mit längerem Prüfprogramm (Prüfläufe bis zu \num{20} Stunden) unter Last mit Audit-Prüfständen in einer möglichst fahrzeugähnlichen Prüfumgebung \cite[][3, 31, 32]{Hametner2001}. Der Anteil der Motoren die eine solche Audit-Prüfung durchlaufen ist nochmals geringer als im Heißtest.
Bei erfolgreichem Abschluss der Herstellung des Motors erfolgt der Transport ins Fahrzeugwerk. Nach dem Einbau in ein Fahrzeug kann erstmals die Funktion auf einem Rollenprüfstand überprüft werden, teilweise erfolgt auch eine Straßenfahrt \cite[][74]{Brummet2006}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Kalttest als \ac{EOL}-Prüfung für Verbrennungsmotoren}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Der Prüfling wird im Kalttest über seine Kurbelwelle elektrisch geschleppt, d.h. er läuft kalt ohne Kraftstoff zu verbrennen. Ein Signalfluss-Schema für den Kalttest zeigt \figref{fig:schema_signalverarbeitung}.
Die Anregung des Prüflings erfolgt dabei einerseits durch die Drehung der Kurbelwelle, andererseits durch das Verstellen von Aktoren am Prüfling wie z.B. dem Drosselklappensteller. Messsignale von Sensoren am Prüfling und Prüfstand werden messtechnisch erfasst und zur Aufzeichnung am Rechner digitalisiert. Die digitalisierten Messsignale können bei Bedarf eine digitale Signalverarbeitung durchlaufen, um z.B. störende Signalanteile zu filtern oder eine Transformation in den Frequenzbereich vorzunehmen. Aus den so aufbereiteten Messsignalen extrahiert die Prüfsoftware schließlich die Istwerte der Prüfmerkmale. Auf Basis dieser Istwerte entsteht letztlich die \ac{iO}/\ac{niO}-Entscheidung als Prüfergebnis des eigentlichen Prüfalgorithmus. Der gesamte Ablauf mit allen Einstellparametern und Prüfgrenzen ist vorab festgelegt und wird bei jedem Prüfvorgang automatisiert ausgeführt. Die Gesamtheit der Einstellparameter wird im folgenden als Prüfprogramm bezeichnet.
\begin{figure}
\centering
\includegraphics{schema_signalverarbeitung}
\caption[Signalfluss-Schema im Prüfvorgang]{Signalfluss-Schema im Prüfvorgang von der Anregung bis zum Prüfergebnis}
\label{fig:schema_signalverarbeitung}
\end{figure}
Zahlreiche Grundlagen des Kalttests für Verbrennungsmotoren sind in der Dissertation von Meier \cite{Meier1992} zu finden. % \texttodo{Veröffentlichungen Meier1992 / Meier1994 ATZ einfügen}.
Sagerer et al. haben die Einführung des Kalttests bei der BMW AG beschrieben \cite{Sagerer1997}. Verbesserungen des Kalttests hinsichtlich Prüfabläufen und Aussagekraft finden sich bei Hametner et al. \cite{Hametner2001, Hametner2002, Hametner2002b}. Häufig genannte Vor- und Nachteile des Kalttests gegenüber dem konventionellen Heißtest in der \ac{EOL}-Prüfung sind in \tabref{tab:Kalttest_Vorteile_Nachteile} aufgelistet.
%\begin{itemize}
%\item eine bessere Erkennung von Fehlerursachen, u.a. zylinderselektive Fehlererkennung \cite[][4]{Meier1992}, \cite{Sagerer1997}, \cite[][11\psq, 17-20]{Gronowski2004}, \cite{Delvecchio2007}, \cite[][78-81]{Martyr2012},
%\item eine höhere Fehlererkennungsrate \cite[][4, 106]{Meier1992}, \cite{Sagerer1997}, \cite{Delvecchio2007},
%\item die geringere Umweltbelastung (keine Abgasemissionen, geringere Geräuschemissionen) und dadurch gesundheitliche Unbedenklichkeit \cite[][4, 106]{Meier1992}, \cite{Sagerer1997}, \cite{Hametner2002}, \cite[][11\psq, 17-20]{Gronowski2004}, \cite[][19]{Brummet2006}, \cite{Delvecchio2007},
%\item es ist keine Kühlmittelversorgung für den Prüfling nötig \cite[][11\psq, 17-20]{Gronowski2004},
%\item die (deutlich) kürzere Prüfzeit mit bis zu \SI{85}{\percent} Einsparung \cite[][4]{Meier1992}, \cite[][11\psq, 17-20]{Gronowski2004}, {Delvecchio2007}, \cite[][78-81]{Martyr2012}
%\item Kostenersparnis bei Betriebs-, Wartungs- und Investitionskosten \cite[][4, 106]{Meier1992}, \cite{Sagerer1997}, \cite{Hametner2002}, \cite[][78-81]{Martyr2012}, u.a. durch den nicht vorhandenen Kraftstoffverbrauch \cite{Hametner2002}, \cite[][11\psq, 17-20]{Gronowski2004}, \cite{Delvecchio2007}, geringeren Platzbedarf in der Montagehalle \cite[][106]{Meier1992}, \cite[][19]{Brummet2006} und Reduzierung des Personalbedarfs \cite[][106]{Meier1992}, \cite{Hametner2002}, \cite[][19]{Brummet2006}, \cite{Delvecchio2007}
%\item eine Steigerung der Unfallsicherheit \cite{Sagerer1997},
%\item und es muss keine Abwärme des Verbrennungsvorgangs abgeführt werden \cite{Sagerer1997}.
%\end{itemize}
%\begin{itemize}
%\item eine bessere Erkennung von Fehlerursachen, u.a. zylinderselektive Fehlererkennung,
%\item eine höhere Fehlererkennungsrate,
%\item die geringere Umweltbelastung (keine Abgasemissionen, geringere Geräuschemissionen) und dadurch gesundheitliche Unbedenklichkeit,
%\item der Entfall der Kühlmittelversorgung für den Prüfling,
%\item die (deutlich) kürzere Prüfzeit mit bis zu \SI{85}{\percent} Einsparung,
%\item eine Kostenersparnis bei Betriebs-, Wartungs- und Investitionskosten u.a. durch den nicht vorhandenen Kraftstoffverbrauch, geringeren Platzbedarf in der Montagehalle und Reduzierung des Personalbedarfs,
%\item eine Verbesserung der Unfallsicherheit,
%\end{itemize}
%Auch potentielle Nachteile des Kalttests gegenüber dem Heißtest werden in der Literatur genannt:
%\begin{itemize}
%\item kein Einlaufen des Prüflings aufgrund der kurzen Prüfzeit erfolgt, daher sind z.B. Ölkanäle u.U. noch nicht vollständig befüllt,
%\item kein Warmlaufen des Motors, daher ist das Verhalten des warmen Motors nur eingeschränkt beurteilbar (einige Geräusche treten erst bei warmem Motor auf),
%\item hohe Schulungskosten / nötiger Erfahrungsschatz für das Bedienpersonal bei der Interpretation der Prüfergebnisse und bei der Parametrierung von Prüfläufen und Prüfgrenzen,
%\item keine direkte Beurteilung der realen Funktionsfähigkeit und des Abgasverhaltens,
%\item ein hoher Bedarf an Voruntersuchungen
%\end{itemize}
%\begin{table}
%\centering
%\caption{Übersicht über die Vor- und Nachteile des Kalttests}
%\label{tab:Kalttest_Vorteile_Nachteile}
%\footnotesize
%\begin{subtable}{\linewidth}
%\caption{Vorteile}
%\rowcolors{1}{myTableShading}{}
%\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
%%\toprule
%bessere Erkennung von Fehlerursachen, u.a. zylinderselektive Fehlererkennung \\
%höhere Fehlererkennungsrate \\
%geringere Umweltbelastung (keine Abgasemissionen, geringere Geräuschemissionen) und dadurch gesundheitliche Unbedenklichkeit \\
%Entfall der Kühlmittelversorgung für den Prüfling \\
%(deutlich) kürzere Prüfzeit mit bis zu \SI{85}{\percent} Einsparung \\
%Kostenersparnis bei Betriebs-, Wartungs- und Investitionskosten u.a. durch den nicht vorhandenen Kraftstoffverbrauch, geringeren Platzbedarf in der Montagehalle und Reduzierung des Personalbedarfs \\
%Verbesserung der Unfallsicherheit
%%\\ \bottomrule
%\end{tabularx}
%\end{subtable}
%%\end{table}
%
%%\begin{table}
%\begin{subtable}{\linewidth}
%\centering
%\caption{Nachteile}
%\footnotesize
%\rowcolors{1}{myTableShading}{}
%\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
%%\toprule
%kein Einlaufen des Prüflings aufgrund der kurzen Prüfzeit erfolgt, daher sind z.B. Ölkanäle u.U. noch nicht vollständig befüllt \\
%kein Warmlaufen des Motors, daher ist das Verhalten des warmen Motors nur eingeschränkt beurteilbar (einige Geräusche treten erst bei warmem Motor auf) \\
%hohe Schulungskosten / nötiger Erfahrungsschatz für das Bedienpersonal bei der Interpretation der Prüfergebnisse und bei der Parametrierung von Prüfläufen und Prüfgrenzen \\
%keine direkte Beurteilung der realen Funktionsfähigkeit und des Abgasverhaltens \\
%hoher Bedarf an Voruntersuchungen
%%\\ \bottomrule
%\end{tabularx}
%\end{subtable}
%\end{table}
\begin{table}
\centering
\caption[Übersicht über die Vor- und Nachteile des Kalttests]{Übersicht über die Vor- und Nachteile des Kalttests \cite[][4, 106]{Meier1992}, \cite{Sagerer1997}, \cite{Hametner2002}, \cite[][11\psq, 17-20]{Gronowski2004}, \cite[][19]{Brummet2006}, \cite{Delvecchio2007}, \cite[][78-81]{Martyr2012}}
\label{tab:Kalttest_Vorteile_Nachteile}
\footnotesize
\rowcolors{2}{}{myTableShading}
\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
%\begin{tabularx}{\textwidth}{>{\kern-\tabcolsep}c<{\kern-\tabcolsep}} %
%\begin{tabular}{>{\kern-\tabcolsep}*{6}{>$c<$}<{\kern-\tabcolsep}}
%\toprule
\cellcolor{myTableHeadingShading} Vorteile \\
%\midrule
bessere Erkennung von Fehlerursachen, u.a. zylinderselektive Fehlererkennung \\
höhere Fehlererkennungsrate \\
geringere Umweltbelastung (keine Abgasemissionen, geringere Geräuschemissionen) und dadurch gesundheitliche Unbedenklichkeit \\
Entfall der Kühlmittelversorgung für den Prüfling \\
(deutlich) kürzere Prüfzeit mit bis zu \SI{85}{\percent} Einsparung \\
Kostenersparnis bei Betriebs-, Wartungs- und Investitionskosten u.a. durch den nicht vorhandenen Kraftstoffverbrauch, geringeren Platzbedarf in der Montagehalle und Reduzierung des Personalbedarfs \\
Verbesserung der Unfallsicherheit
%\\ \bottomrule
\end{tabularx}
\vspace*{5mm}
\rowcolors{2}{}{myTableShading}
\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
%\toprule
\cellcolor{myTableHeadingShading} Nachteile \\
%\midrule
kein Einlaufen des Prüflings aufgrund der kurzen Prüfzeit erfolgt, daher sind z.B. Ölkanäle u.U. noch nicht vollständig befüllt \\
kein Warmlaufen des Motors, daher ist das Verhalten des warmen Motors nur eingeschränkt beurteilbar (einige Geräusche treten erst bei warmem Motor auf) \\
hohe Schulungskosten / nötiger Erfahrungsschatz für das Bedienpersonal bei der Interpretation der Prüfergebnisse und bei der Parametrierung von Prüfläufen und Prüfgrenzen \\
keine direkte Beurteilung der realen Funktionsfähigkeit und des Abgasverhaltens \\
hoher Bedarf an Voruntersuchungen
\end{tabularx}
%\end{subtable}
\end{table}
Ganz grundsätzlich gilt, dass der Betriebszustand des Motors im Kalttest nur wenig mit dem Realbetrieb im Fahrzeug gemein hat. Daher können die Prüfgrenzen auch nicht einfach unmittelbar aus dem Entwicklungsprozess bzw. Einsatzzweck des Prüflings abgeleitet werden. Es handelt sich vielmehr um eine vergleichende Prüfung, d.h. jeder Prüfling wird indirekt über die Prüfgrenzen mit den zuvor hergestellten Motoren verglichen.
%==============================================================================
\subsection{Aufbau eines typischen Kalttest-Prüfstandes}
%==============================================================================
Die Prüfstände sind in die Montagelinie integriert und in Schallschutzkabinen untergebracht.
Den grundlegenden Aufbau eines Kalttest-Prüfstandes zeigt \figref{fig:schema_pruefstand}, eine detaillierte Beschreibung findet sich z.B. in den Arbeiten von Wiederer \cite{Wiederer2015, Wiederer2016}. Die Kurbelwelle des Prüflings ist über einen Antriebsadapter, eine Kupplung und einen Drehmomentsensor mit der schleppenden E-Maschine verbunden. Als Antrieb dient eine drehzahlgeregelte Asynchronmaschine. Der Antrieb der Ölpumpe, der Kraftstoffpumpe und der beiden erfolgt intern über die Steuerketten des Prüflings. Ein Ansaug- und ein Abgasadapter mit je einer Drosselblende und einem Differenzdruck-Sensor erlauben es, die Luftströmung durch den Prüfling anhand des Druckabfalls an der Blende zu messen.
%Die Blendendurchmesser liegen im Bereich weniger Millimeter, z.B. Vierzylinder-Ottomotoren Einlass \SI{1}{mm} und Auslass \SI{2.5}{mm} \cite{Wiederer2016}, Differenzdruckmessung
Der Ansaugadapter kann an zwei Positionen (Position 1 am Eingang der Saugstrecke vor der Drosselklappe und Position 2 am Ausgang des Turbolader-Verdichters) genutzt werden. Der Abgasadapter ist am Auslass der Turbolader-Turbine angebracht. Zu beachten ist, dass im Prüflauf kein Ladeluftkühler vorhanden ist. Der Ausgang des Verdichters und der Eingang der Saugstrecke sind daher zur Umgebung hin offen.
Zur Kraftstoffversorgung und Messung des Öldrucks ist der Prüfling außerdem über eine Multifunktions-Kupplungsplatte mit dem Prüfstand verbunden. Es befindet sich während der Prüfung also sehr wohl Kraftstoff im Prüfling, der allerdings weder in die Brennräume eingespritzt noch gezündet wird. Der Kraftstoff im Prüfling wird benötigt da die Kraftstoffpumpe aktiv ist \cite[][55]{Brummet2006}.
%Kalttest-Prüfungen gewöhnlich ohne Kühlmittel
Die Verbindung des Motor-Kabelbaums zum Prüfstand erfolgt über einen Elektronik-Adapter. Beispielhaft zeigt \figref{fig:schema_pruefstand} den Druck- und Temperatursensor im Saugrohr, den Drosselklappensteller, das Wastegate und das Schubumluftventil als elektrische Sensoren und Aktoren am Prüfling. Aktoren am Prüfling die während des Prüflaufs angesteuert werden und Messgrößen die im Prüflauf aufgenommen werden sind in \tabref{tab:Kalttest_Aktoren_Messgroessen} angeführt.
\begin{figure}
\centering
\includegraphics{schema_pruefstand}
\caption[Schematischer Aufbau eines Kalttest-Prüfstandes für Verbrennungsmotoren]{Schematischer Aufbau eines Kalttest-Prüfstandes für Verbrennungsmotoren, vgl. \cite{Wiederer2016}}
\label{fig:schema_pruefstand}
\end{figure}
%Steller am Prüfling die während des Prüflaufs angesteuert werden sind \cite[][33-34]{Wiederer2015}:
%\begin{itemize}
%\item Drosselklappe,
%\item Ladungsbewegungsklappen,
%\item Nockenwellenverstellung auf der Einlassseite,
%\item Nockenwellenverstellung auf der Auslassseite,
%\item Variabler Ventilhub,
%\item Zündsystem,
%\item Hochdruck- und Niederdruck-Einspritzventile (kein Öffnen),
%\item Kühlwasserregelung,
%\item Aktivkohlefilter-Ventil,
%\item Wastegate,
%\item Schubumluftventil,
%\item Kolbenkühldüsen,
%\item Ölpumpe,
%\item Kraftstoffpumpe,
%\item Drosselklappenstellung,
%\item Nockenwellengeber
%\end{itemize}
%Messgrößen die im Prüflauf aufgenommen werden sind \cite[][34-36]{Wiederer2015}:
%\begin{itemize}
%\item Schlepp-Drehmoment,
%\item Drehzahl und Winkelposition der Kurbelwelle,
%\item Ansaugdruck vor der Drosselklappe (Ansaugadapter Position 1),
%\item Ausgangsdruck am Turbolader-Verdichter (Ansaugadapter Position 2),
%\item Abgasdruck am Ausgang der Abgasturbolader-Turbine (Abgasadapter),
%\item Saugrohrdruck und -temperatur,
%\item Position der Ladungsbewegungsklappen,
%\item Position des Wastegate,
%\item Öldruck und -temperatur,
%\item Kraftstoffdruck Niederdruck- und Hochdrucksystem,
%\item Position des Kühlwasserreglers,
%\item Kühlwassertemperatur,
%\item Unterdruck der Vakuumpumpe,
%\item Nockenwellengebersignal, Kurbelwellengebersignal, Nockenwellenverstellwinkel,
%\item Rückwurfsignal des variablen Ventilhubs,
%\item Stromaufnahme und Ansteuersignale der Aktoren %Wastegate-Steller, Schubumluftventil, Ölpritzdüsen-Ventil, Kraftstoff-Mengensteuerventil, Drosselklappensteller, Steller der Kühlwasserregelung, Nockenwellenversteller-Ventile, Hochdruck- und MP-Kraftstoffinjektoren, Zündkerzen
%\item Körperschallaufnehmer und Laservibrometer am Kurbelgehäuse,
%\item Luftschall-Mikrofone,
%\item Klopfsensor,
%\item Umgebungstemperatur und Luftdruck,
%\item Versorgungsspannungen \SI{5}{V} und \SI{12}{V}
%%Abgasdruck, Öldruck, Öltemperatur, Drehzahl, Geräuschprüfung \cite[][3,29]{Hametner2001}
%%\item Zündsystem, Gemischbildner \cite{Hametner2002}
%%\item Drehmoment, Ansaugunterdruck, Abgasgegendruck, Öldruck (statisch und dynamisch), Öltemperatur \cite[][4]{Meier1992}
%%\item Bei Meier noch ausstehende \ac{EOL}-Prüfung von Gemischbildnern und Zündsystemen \cite[][4]{Meier1992} inzwischen Standard
%%\item automatischer Lecktest Ölraum; manueller Lecktest Wasserraum; Schleppstation Überprüfung HVA; Eletronikprüfung Sensoren/Aktoren/NWS; Zündtest; Gemischbildnertest Einspritzventile, Druckregler, Dichtheit Kraftsoff; Mechaniktest (Schleppmoment, Abgasgegendruck, Ansaugunterdruck, Öldruck statisch und dynamisch); Klopfsensor, Verstellzeit/Winkel NWS \cite{Sagerer1997}
%%\item Mechanik-Test: Drehmoment, Kurbelwellengeber, Nockenwellengeber, Ansaugdruck, Abgasdruck, Öldruck, Kraftstoffdruck \cite[][57]{Brummet2006}
%%\item Aktor-/Sensor-Test: Temperatursensoren, Klopfsensor, Drosselklappe, Saugrohrklappen \cite[58]{Brummet2006}
%%\item Gemischbildner-Test: Ströme der Kraftstoff-Injektoren \cite[][58]{Brummet2006}
%%\item Zündungs-Test: Induzierte Spannungen an den Zündspulen \cite[][58-59]{Brummet2006}
%%\item Drehmoment, Auslassdruck, Körperschall, Öldruck \cite{Delvecchio2007}
%\end{itemize}
%\begin{table}
%\centering
%\caption{Steller am Prüfling die während des Prüflaufs angesteuert werden}
%\label{tab:Kalttest_Steller}
%\footnotesize
%
%\rowcolors{1}{myTableShading}{}
%%\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
%\begin{tabular}{@{\kern\tabcolsep}l<{\kern\tabcolsep}} %
%Drosselklappe \\
%Ladungsbewegungsklappen \\
%Nockenwellenverstellung auf der Einlassseite \\
%Nockenwellenverstellung auf der Auslassseite \\
%Variabler Ventilhub \\
%Zündsystem \\
%Hochdruck- und Niederdruck-Einspritzventile (kein Öffnen) \\
%Kühlwasserregelung \\
%Aktivkohlefilter-Ventil \\
%Wastegate \\
%Schubumluftventil \\
%Kolbenkühldüsen \\
%Ölpumpe \\
%Kraftstoffpumpe \\
%Drosselklappenstellung \\
%Nockenwellengeber
%\end{tabular}
%\end{table}
%
%
%\begin{table}
%\centering
%\caption{Messgrößen die im Prüflauf aufgenommen werden}
%\label{tab:Kalttest_Messgroessen}
%\footnotesize
%
%\rowcolors{1}{myTableShading}{}
%%\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
%\begin{tabular}{@{\kern\tabcolsep}l<{\kern\tabcolsep}} %
%Schlepp-Drehmoment \\
%Drehzahl und Winkelposition der Kurbelwelle \\
%Ansaugdruck vor der Drosselklappe (Ansaugadapter Position 1) \\
%Ausgangsdruck am Turbolader-Verdichter (Ansaugadapter Position 2) \\
%Abgasdruck am Ausgang der Abgasturbolader-Turbine (Abgasadapter) \\
%Saugrohrdruck und -temperatur \\
%Position der Ladungsbewegungsklappen \\
%Position des Wastegate \\
%Öldruck und -temperatur \\
%Kraftstoffdruck Niederdruck- und Hochdrucksystem \\
%Position des Kühlwasserreglers \\
%Kühlwassertemperatur \\
%Unterdruck der Vakuumpumpe \\
%Nockenwellengebersignal, Kurbelwellengebersignal, Nockenwellenverstellwinkel \\
%Rückwurfsignal des variablen Ventilhubs \\
%Stromaufnahme und Ansteuersignale der Aktoren \\ %Wastegate-Steller, Schubumluftventil, Ölpritzdüsen-Ventil, Kraftstoff-Mengensteuerventil, Drosselklappensteller, Steller der Kühlwasserregelung, Nockenwellenversteller-Ventile, Hochdruck- und MP-Kraftstoffinjektoren, Zündkerzen
%Körperschallaufnehmer und Laservibrometer am Kurbelgehäuse \\
%Luftschall-Mikrofone \\
%Klopfsensor \\
%Umgebungstemperatur und Luftdruck \\
%Versorgungsspannungen \SI{5}{V} und \SI{12}{V}
%\end{tabular}
%\end{table}
\begin{table}
\centering
\caption[Typische Aktoren und Messgrößen im Kalttest von Ottomotoren]{Typische Aktoren und Messgrößen im Kalttest von Ottomotoren \cite[][33-36]{Wiederer2015}}
\label{tab:Kalttest_Aktoren_Messgroessen}
\footnotesize
\rowcolors{2}{}{myTableShading}
%\begin{tabular}{@{}l@{}}
%\begin{tabular}{@{\kern\tabcolsep}l<{\kern\tabcolsep}} %
\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
\cellcolor{myTableHeadingShading} Aktoren \\
%\toprule
%Aktoren \\
%\midrule
Drosselklappe \\
Ladungsbewegungsklappen \\
Nockenwellenverstellung auf der Einlassseite \\
Nockenwellenverstellung auf der Auslassseite \\
Variabler Ventilhub \\
Zündsystem \\
Hochdruck- und Niederdruck-Einspritzventile (kein Öffnen) \\
Kühlwasserregelung \\
Aktivkohlefilter-Ventil \\
Wastegate \\
Schubumluftventil \\
Kolbenkühldüsen \\
Ölpumpe \\
Kraftstoffpumpe \\
Drosselklappensteller \\
Nockenwellengeber
%\\ \bottomrule
\end{tabularx}
\vspace*{5mm}
\centering
%\caption{Messgrößen die im Prüflauf aufgenommen werden}
%\label{tab:Kalttest_Messgroessen}
\footnotesize
\rowcolors{2}{}{myTableShading}
%\begin{tabular}{@{\kern\tabcolsep}l<{\kern\tabcolsep}} %
\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}X<{\kern\tabcolsep}} %
\cellcolor{myTableHeadingShading} Messgrößen \\
Schlepp-Drehmoment \\
Drehzahl und Winkelposition der Kurbelwelle \\
Ansaugdruck vor der Drosselklappe (Ansaugadapter Position 1) \\
Ausgangsdruck am Turbolader-Verdichter (Ansaugadapter Position 2) \\
Abgasdruck am Ausgang der Abgasturbolader-Turbine (Abgasadapter) \\
Saugrohrdruck und -temperatur \\
Position der Ladungsbewegungsklappen \\
Position des Wastegate \\
Öldruck und -temperatur \\
Kraftstoffdruck Niederdruck- und Hochdrucksystem \\
Position des Kühlwasserreglers \\
Kühlwassertemperatur \\
Unterdruck der Vakuumpumpe \\
Nockenwellengebersignal, Kurbelwellengebersignal, Nockenwellenverstellwinkel \\
Rückwurfsignal des variablen Ventilhubs \\
Stromaufnahme und Ansteuersignale der Aktoren \\ %Wastegate-Steller, Schubumluftventil, Ölpritzdüsen-Ventil, Kraftstoff-Mengensteuerventil, Drosselklappensteller, Steller der Kühlwasserregelung, Nockenwellenversteller-Ventile, Hochdruck- und MP-Kraftstoffinjektoren, Zündkerzen
Körperschallaufnehmer und Laservibrometer am Kurbelgehäuse \\
Luftschall-Mikrofone \\
Klopfsensor \\
Umgebungstemperatur und Luftdruck \\
Versorgungsspannungen \SI{5}{V} und \SI{12}{V}
\end{tabularx}
\end{table}
Eine große Bedeutung kommt dabei den Luft- und Körperschallsignalen zu die über Mikrofone und Schwingungssensoren gemessen werden, da sich über diese Signale viele Fehler erkennen lassen \cite{Jonuscheit2000}, \cite[][3]{Hametner2001}, \cite[][59-62]{Brummet2006}. Bei der Bewertung der Luft- und Körperschall ist es vorteilhaft, dass im Prüfling Verbrennung erfolgt und daher kein Verbrennungsgeräusch auftritt \cite{Delvecchio2007}.
%==============================================================================
\subsection{Ablauf der Prüfung}
%==============================================================================
%\texttodo{Foto Prüfling vorbereitet [Wiederer2015, p. 27]}
Die nachfolgende Beschreibung des Prüfablaufs orientiert sich an der Arbeit von Wiederer \cite[][28-32, 36-38]{Wiederer2015}. Beschreibungen von Kalttest-Prüfläufen finden sich auch bei Hametner \cite[][26\psq]{Hametner2001}, Gronowski \cite[][14\psq]{Gronowski2004} und Brummet \cite[][21\psq, 71, 82]{Brummet2006}.
Nach der Montage werden die Prüflinge zunächst außerhalb der Prüfstände für die Prüfung vorbereitet. Dazu zählt die Ölbefüllung, die Verkabelung der Sensoren und Aktoren zum Elektronik-Adapter und die Schlauchverbindung für Kraftstoff und Öldruck zur Multikupplungsplatte. Der gesamte Prüfvorgang ab dem Einfahren des Prüflings in den Prüfstand erfolgt vollautomatisch. Zunächst wird im Spannvorgang die Verbindung der Antriebswelle zur Kurbelwelle des Prüflings hergestellt. Ein Industrieroboter bringt den passenden Ansaug- und Abgasadapter am Prüfling an. Der Ansaugadapter wird dabei zunächst in Position 1 (siehe \figref{fig:schema_pruefstand}) gebracht. Erst im letzten Teil der Prüfung positioniert der Roboter den Ansaugadapter auf Position 2, um den Luftdurchsatz für die Turboladerprüfung zu erhöhen und den Ladedruck am Verdichterausgang zu messen. Zu diesem Zweck lassen sich auch die Drosseldurchmesser in den Adaptern durch die Prüfsoftware verstellen.
\begin{figure}
\centering
\includegraphics{drehzahlverlauf_pruefung}
\caption[Schematischer Drehzahlverlauf einer Kalttestprüfung]{Schematischer Drehzahlverlauf einer Kalttestprüfung mit Teilprüfungen, vgl. \cite[][38]{Wiederer2015}}
\label{fig:drehzahlverlauf_pruefung}
\end{figure}
Der eigentliche Prüflauf mit der Betätigung von Aktoren und der Erfassung von Messsignalen ist zeitlich in Teilprüfungen mit unterschiedlichem Fokus der Prüfung gegliedert. Den Drehzahlverlauf und die einzelnen Teilprüfungen zeigt \figref{fig:drehzahlverlauf_pruefung}. Im Verlauf der Prüfung ist bei groben Fehlern (z.B. Welle blockiert oder elektrische Steckverbindung nicht kontaktiert) ein vorzeitiger Abbruch möglich. Dies dient einerseits dem Schutz von Prüfling und Prüfstand, andererseits als Einsparung von Prüfzeit bei einem bereits absehbaren \ac{niO}-Prüfergebnis.
Beim Start der Prüfung werden zunächst im Stillstand die elektrischen Bauteile des Motors mit Spannung versorgt und deren korrekte Verkabelung geprüft. Dazu zählen auch das Zünd- und das Einspritzsystem.
Im zweiten Schritt beginnt die E-Maschine den Prüfling bis auf eine Drehzahl von \SI{60}{1/min} anzutreiben, während das Losbrechmoment bestimmt wird. Nach Erhöhung der Drehzahl auf \SI{400}{1/min} fährt das System für variablen Ventilhub in Grundstellung. Auf eine weitere Drehzahlerhöhung auf \SI{1000}{1/min} folgt der Aufbau des Öldrucks durch die motorinterne Ölpumpe und die Prüfung der mechanischen Verstelleinheiten für Nockenwelle, Ventilhub usw.
Aufgrund der starken Drosselung im Ansaugtrakt durch die Blende am Ansaugadapter während des Kalttests entsteht bei geöffneten Ventilen eine starke Rückströmung der Luft vom Auslass über die Brennräume der Zylinder hin zum Einlass. Es bestehen also besondere Betriebsbedingungen im Kalttest, die im Heißtest aufgrund der Kraftstoffverbrennung so nicht umsetzbar sind. Eine zylinderselektive Überprüfung der Motor-Grundmechanik lässt sich am besten bei niedriger Drehzahl durchführen, weshalb für die eigentliche Mechanik-Prüfung die Drehzahl auf \SI{120}{1/min} reduziert wird. Durch das langsame Aufeinanderfolgen der Ansaug- und Ausschiebe-Vorgänge ist eine gute Zuordnung der Drucksignale am Einlass und Auslass und des Schleppmoments zu den einzelnen Zylindern möglich. Nach Abschluss der Mechanik-Teilprüfung folgt das Versetzen des Ansaugadapters vom Saugrohr zum Einlass des Turbolader-Verdichters durch den Roboter. Die finale Teilprüfung ist auf den Turbolader fokussiert. Um die Turbine im Turbolader auf Drehzahl zu bringen ist ein großer Luftdurchsatz im Prüfling nötig, daher läuft die Turbolader-Prüfung mit Kurbelwellen-Drehzahlen bis \SI{3000}{1/min}. Nach der Turbolader-Prüfung ist der eigentliche Prüflauf beendet, der Antrieb wird angehalten. Der Prüfling wird automatisch ausgespannt und fährt aus dem Prüfstand. Parallel wertet die Prüfstands-Software die digitalisierten Messsignale aus und berechnet die Istwerte der Prüfmerkmale.
Anhand der Istwerte erfolgt die \ac{iO}/\ac{niO}-Bewertung der Prüfung. Bei einer \ac{niO}-Bewertung fährt der Prüfling vom Prüfstand in eine \ac{niO}-Schleife, in der ein Mechaniker anhand der Messsignale über die Art des Fehlers entscheidet.
Einfache Fehler (z.B. fehlende Steckverbindung) werden sofort beseitigt und der Prüfling erneut geprüft. Bei größeren Fehlern kommt der Prüfling zu einem Nacharbeitsplatz und wird zerlegt/analysiert \cite{Sagerer1997}, \cite[][11]{Gronowski2004}.
% \texttodo{Anzahl der \ac{EOL}-Prüfstände: Dauer der Kalttest-Prüfung wenige Minuten, Linientakt kürzer, mehrere Prüfstände}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Berechnung und Bewertung von Prüfmerkmalen}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Der grobe Signalfluss von der Anregung des Prüflings bis zum Prüfergebnis wurde bereits in \figref{fig:schema_signalverarbeitung} dargestellt. Im Detail erfasst die Messtechnik die elektrischen Messsignale je nach Teilprüfung in äquidistanten Zeit- oder Kurbelwinkelabständen. Die darauf folgende digitale Signalverarbeitung hat wesentliche Bedeutung für die Auswertung der Luft- und Körperschallsignale. Der Grund dafür liegt in deren komplexen Signalzusammensetzung. Eingesetzte Methoden der Signalverarbeitung für Luft- und Körperschallsignale sind z.B. die Ordnungsanalyse, Fouriertransformationen, Leistungsdichtespektren, Sonagramme und das Cepstrum. Grundlagen der Sensorik und Signalverarbeitung für Vibrationssignale beschreiben Garibaldi und Antoni \cite{Garibaldi2004}. Die Einführung am Beispiel der Turbolader-Prüfung bei Vierzylinder-Ottomotoren findet sich in der Arbeit von Brummet \cite[][23-48]{Brummet2006}. Die genaue Auswahl der Signalverarbeitungsmethoden ist spezifisch an einzelne Motorbauteile und mögliche Fehlerfälle angepasst. So unterscheiden sich z.B. die Drehzahlen und damit die relevanten Ordnungen (Vielfache der Kurbelwellendrehzahl) für den Kurbeltrieb (Kurbelwellendrehzahl), Ventiltrieb (halbe Kurbelwellendrehzahl), Ausgleichswellen (doppelte Kurbelwellendrehzahl) und einzelne Zahnräder (Zahneingriffsfrequenzen) \cite{Jonuscheit2000} \cite[][32-44]{Hametner2001}. Delvecchio et al. \cite{Delvecchio2007, Delvecchio2007b, Delvecchio2010, Delvecchio2012, Delvecchio2015} haben in mehreren Veröffentlichungen die Signalverarbeitung speziell für Körperschallsignale im Kalttest von Otto- und Dieselmotoren weiterentwickelt. Da in der vorliegenden Arbeit im Prüfalgorithmus eine rein datenbasierte und möglichst merkmalsneutrale Methodik verfolgt wird, ist die genaue Abfolge der Verarbeitungsschritte in der digitalen Signalverarbeitung von untergeordneter Bedeutung.
\begin{figure}
\centering
\subcaptionbox{unauffälliges Signal}
{
\centering
\includegraphics{window_iO}
\label{fig:window_iO}
}
% ---------------
\subcaptionbox{auffälliges Signal}
{
\centering
\includegraphics{window_niO}
\label{fig:window_niO}
}
\caption[Bestimmung des Istwertes eines Prüfmerkmals]{Bestimmung des Istwertes eines Maximum-Prüfmerkmals mit unauffälligem und auffälligem Beispielsignal, vgl. \cite{Wiederer2016}}
\label{fig:window}
\end{figure}
Der Signalverarbeitung folgt die Berechnung der Istwerte für alle Prüfmerkmale. Ein Beispiel hierfür zeigt \figref{fig:window}. Die Auswertung erfolgt dabei in einem vorab durch das Prüfprogramm für jedes Prüfmerkmal festgelegten Abszissenbereich des zu prüfenden Signals. Im Beispiel ist in der Abszissenrichtung die Zeit $t$ aufgetragen, entsprechend wird das Signal $y(t)$ nur im festgelegten Zeitbereich ausgewertet um den Istwert für dieses Prüfmerkmal zu erhalten. Andere mögliche Abszissendimensionen sind der Kurbelwinkel oder bei entsprechender vorgelagerter Signalverarbeitung z.B. die Frequenz oder Drehzahl-Ordnung. Innerhalb des relevanten Signalabschnitts kommt eine Auswertefunktion entsprechend des Merkmalstyps zur Anwendung, die den Signalverlauf auf einen skalaren Merkmals-Istwert pro Merkmal reduziert. Im Beispiel wird das Maximum $\max(y(t))$ ausgewertet, es handelt sich also um ein Merkmal vom Typ Maximum. Eine Übersicht einfacher Merkmalstypen zeigt \tabref{tab:Auswertefunktionen}. Praktisch ist die Berechnung der Merkmals-Istwerte gleichzusetzen mit einer auf den Prüfling angepassten Datenreduktion, bei der das Vorwissen über die für die Prüfung relevanten Eigenschaften des Prüflings in der Definition der Merkmale steckt \cite[][p. 298]{Venkatasubramanian2003}.
%Praktisch liegen die Messsignale zum Zeitpunkt der Berechnung der Merkmals-Istwerte in digital abgetasteter Form vor, d.h. es handelt sich um eine Abfolge von $\numS$ Messwerten $y\bracks{\indexS}, \indexS \in \msbegin{1, \, \ldots, \, \numS}$.
\begin{table}
\centering
\caption[Übersicht über gängige Merkmalstypen]{Übersicht über gängige Merkmalstypen zur Bestimmung von Merkmals-Istwerte}
\footnotesize
\label{tab:Auswertefunktionen}
%\rowcolors{2}{}{myTableShading}
%\begin{tabular}{@{}lll@{}}
%\begin{tabular}{@{\kern\tabcolsep}lll<{\kern\tabcolsep}} %
\begin{tabularx}{\textwidth}{@{}llX@{}}
\toprule
Bezeichnung & Kürzel & Beschreibung \\
\midrule
Minimum & min & minimaler Wert des Signals \\ % k ok, d ok
Maximum & max & maximaler Wert des Signals \\ % k ok, d ok
Position Minimum & xmin & Abszissen-Position des Minimums des Signals \\ % k ok, d ok
Position Maximum & xmax & Abszissen-Position des Maximums des Sginals \\ % k ok, d ok
Mittelwert & mean & Mittelwert des Signals \\ % k ok (int), d ok (sum)
Peak-to-Peak & diff & Differenz zwischen Maximum des Signals und Minimum des Signals \\ % k ok, d ok
Integral & int & Integral des Signals \\ % k ok, d nok (trapz)
Absolutwert-Integral & absint & Integral des Absolutwertes des Signals \\ % k ok (int), d nok (trapz)
Nulldurchgänge & null & Anzahl der Nulldurchgänge des Signals \\ % k nok, d ok
Position Nulldurchgang & xnull & Position des ersten Nulldurchgangs des Signals \\ % k nok, d ok
% weitere: Crestfactor, Kurtosis, RMS, Skewness
\bottomrule
\end{tabularx}
\end{table}
Aus dem Abszissenbereich sowie der oberen und unteren Grenze für den ermittelten Istwert ergibt sich für jedes Prüfmerkmal ein Fenster. Dieses Fenster legt bei der konventionellen Herangehensweise mit manuell definierten Prüfgrenzen ein Prüfingenieur im Prüfprogramm fest. Es wird im Prüfstand für die \ac{iO}-/\ac{niO}-Bewertung verwendet. Befinden sich die Istwerte aller Prüfmerkmale eines Prüflings innerhalb der jeweiligen Grenzen, dann erfolgt eine \ac{iO}-Bewertung. Sobald eines der Merkmale seine Grenzen verlässt, gilt die Prüfung als \ac{niO} bewertet. Eine Beschreibung der Fenstertechnik findet sich z.B. bei Meier \cite[][44\psq]{Meier1992}. Sie ist der verbreitete Standard in der Kalttestprüfung und darüber hinaus in der Überwachung zahlreicher Herstellprozesse wie z.B. Schraubvorgänge.
Typisch für die manuelle Parametrierung der Prüfgrenzen im Prüfprogramm ist die Analyse von Messdaten (Istwerten von Prüfmerkmalen) manuell selektierter \ac{iO}-Prüflinge und manuell in Prüflinge eingebauter, definierter Fehlerfälle (\glqq{}Mapping\grqq) \cite[][97-105]{Meier1992}, \cite{Jonuscheit2000}.
Die Prüfgrenzen richten sich also nicht primär nach bei der Entwicklung des Prüflings festgelegten Toleranzen, sondern werden im Sinne einer vergleichenden Prüfung anhand der Serienstreuung der laufenden Produktion festgelegt. Eine grobe Parametrierung der Prüfgrenzen kann unter Umständen bereits beim Hersteller des Prüfstandes erfolgen, die dort festgelegten Prüfgrenzen sind in der Regel sehr weit \cite[][20]{Gronowski2004}. Die laufende Anpassung erfolgt dann nach heutigem Stand bei laufender Produktion manuell mit einfachen Methoden wie z.B. Histogrammen \cite[][20-21]{Gronowski2004}.
Gronowski \cite[86][]{Gronowski2004} hat in seiner Arbeit festgestellt, dass das volle Potential der Kalttest-\ac{EOL}-Prüfung nur erreicht wird, wenn eine kontinuierliche Anpassung der Prüfprogramme inkl. Prüfgrenzen anhand von realen Messdaten aus der laufenden Produktion erfolgt.
Beachtenswert ist, dass die Abläufe bei dieser manuellen Herangehensweise teilweise ähnlich zu den Methoden der \ac{SPC} sind (vgl. \secref{sec:SPC}).
Bzgl. algorithmischer bzw. lernfähiger Verfahren zur Festlegung der Prüfgrenzen im Kalttest beschreibt Meier \cite[][4]{Meier1992} Auswerteverfahren, die er der künstlichen Intelligenz zuordnet. Im Rahmen der Arbeit ist festgestellt worden, dass die Inbetriebnahme neuer Prüfstände oder Änderungen an der Motorkonstruktion erheblichen Aufwand bei der manuellen Neuparametrierung der Prüfgrenzen in Form von Fenstern erzeugen. Als Lösungsansätze wurden Expertensysteme und neuronale Netze untersucht. Bei den Expertensystemen werden weiterhin manuell die zulässigen \ac{iO}-Toleranzen sowie die Zuordnung von Signalabweichungen zu Fehlerursachen angegeben, nur die Auswertung erfolgt automatisiert \cite[][45-47]{Meier1992}. Eine genauere Beschreibung der verwendeten Algorithmen neuronaler Netze ist nicht vorhanden, die Arbeit kann aber den bereits in \secref{subsec:introduction_databased} beschriebenen datenbasierten Verfahren zur Fehlererkennung zugeordnet werden. Einen ähnlichen Ansatz zur Klassifikation mit neuronalen Netzen beschreiben Jonuscheit und Strama \cite{Jonuscheit2000}. Grundlegend erwähnt (aber nicht weitergehend untersucht) werden modellbasierte Verfahren (vgl. \secref{subsec:introduction_modelbased}) und datenbasierte Verfahren (vgl. \secref{subsec:introduction_databased}) zur Fehlererkennung im Kalttest von Garibaldi, Antoni und Delvecchio \cite{Garibaldi2004, Delvecchio2012}. Wiederer \cite{Wiederer2015} hat außerdem ein auf den Kalttest von Ottomotoren zugeschnittenes 0D-Simulationsmodell erstellt, das sowohl zufällig verteilte Bauteilabweichungen als auch Fehlerfälle der Motor-Grundmechanik und Gasdynamik wiedergeben kann.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Verwendete Beispieldatensätze und Prüfmerkmale}
\label{eq:Datasets}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Die Untersuchungen in den nachfolgenden Kapitel erfolgen beispielhaft anhand von Datensätzen aus der Motorenproduktion der AUDI AG in Győr, Ungarn. Bei den Prüflingen handelt es sich um Vierzylinder-Viertakt-Ottomotoren vom Typ EA888 der dritten Generation mit \SI{2.0}{l} Hubraum und Abgasturbolader. Eine Beschreibung des Motors findet sich bei Eisner et al. \cite{Eiser2011} und Heiduk et al. \cite{Heiduk2011}. Details zur \ac{EOL}-Prüfung dieses Motortyps behandelt Wiederer \cite{Wiederer2015, Wiederer2016}.
Die Kalttestprüfung dauert pro Prüfling ca. eineinhalb Minuten und umfasst \num{95} Messkanäle in \num{26} Teilprüfungen, die in insgesamt \num{346} erfassten Signalen pro Prüflauf resultieren. Ausgewertet werden \num{334} % nnz((~flagsEnvironmentalScalarWindows) & (featureDataCalcEnv.tableWindows.isScalar) )
zu prüfende Merkmale, deren Wertebereiche teilweise kontinuierlich und teilweise ganzzahlig sind.
Ganzzahlige Merkmalswerte entstehen bei der Zählung von Nulldurchgängen mit dem Merkmalstyp \glqq{}null\grqq (siehe \tabref{tab:Auswertefunktionen}), da ein Signal im gegebenen Abszissenbereich eines Merkmals nur eine ganzzahlige Anzahl an Nulldurchgängen aufweisen kann. Ein Anwendungsfall für solche Merkmale sind die Signale der Winkelgeber an Kurbel- und Nockenwelle, die einen rechteckförmigen Verlauf mit einer festen Anzahl an Signalflanken je Umdrehung aufweisen.
Da bei Merkmalen mit ganzzahligem Wertebereich ein einziger als \ac{iO} gültiger Istwert festgelegt werden kann, sind die Prüfgrenzen einfach festzulegen und der Einsatz lernfähiger Algorithmen nicht interessant. Dementsprechend verbleiben
\num{326} % numel(idWindowRate)
Prüfmerkmale mit kontinuierlichem Wertebereich für die weitere Untersuchung.
Die Messdaten stammen von vier in die Montagelinie integrierten \ac{EOL}-Prüfständen gleicher Bauart. In diesen Prüfständen werden alle auf der Montagelinie hergestellten Motortypen geprüft, darunter befinden sich auch Prüflinge mit \SI{1.8}{l} Hubraum. Um die Anzahl der Prüfprogramme überschaubar zu halten sind zueinander weitgehend gleiche Motortypen in gemeinsamen Prüfprogrammen zusammengefasst. Dies betrifft z.B. Typen mit fahrzeugspezifische Änderungen an der Saugstrecke, ansonsten aber gleichem Motoraufbau. Die nachfolgenden Untersuchungen umfassen drei Motortypen, die heute alle im gleichen Prüfprogramm und entsprechend mit den gleichen Prüfgrenzen geprüft werden. \Tabref{tab:Dataset} zeigt eine Übersicht über die Anzahl der Prüfläufe je untersuchtem Motortyp und Prüfstand. Erfasst wurden die Prüfläufe über einen Gesamtzeitraum von \num{138} Tagen.
\begin{table}
\caption[Übersicht über die Zusammensetzung der untersuchten Beispieldatensätze]{Übersicht über die Zusammensetzung der untersuchten Prüfläufe in den Beispieldatensätzen (gesamt, \ac{iO}, \ac{niO}) gemäß der manuellen Prüfgrenzen \textfixme{Tabelle formatieren; centering?} }
\label{tab:Dataset}
\footnotesize
\begin{tabular}{llllll}
\toprule
%\begin{tabularx}{\textwidth}{@{\kern\tabcolsep}XXXXXX<{\kern\tabcolsep}} %
Motortyp & Prüfstand P1 & Prüfstand P2 & Prüfstand P3 & Prüfstand P4 & Summe \\
\midrule
Motortyp M1 & 5897, 5516, 381 & 2548, 2348, 200 & 4392, 4135, 257 & 6130, 5714, 416 & 18967, 17713, 1254 \\
Motortyp M2 & 385, 356, 29 & 144, 139, 5 & 266, 257, 9 & 420, 402, 18 & 1215, 1154, 61 \\
Motortyp M3 & 489, 437, 52 & 232, 212, 20 & 350, 321, 29 & 518, 468, 50 & 1589, 1438, 151 \\
Summe & 6771, 6309, 462 & 2924, 2699, 225 & 5008, 4713, 295 & 7068, 6584, 484 & 21771, 20308, 1466 \\
\bottomrule
\end{tabular}
\end{table}
% \num{64} Umgebungsmerkmale inkl. selbst erstellter und berechneter % nnz(idWindowEnvironmental)
% \num{62} Umgebungsmerkmale inkl. selbst erstellter ohne berechneter % nnz(idWindowEnvironmental<9900)
% \num{23} Umgebungsmerkmale aus Original-Prüfprogramm % nnz(idWindowEnvironmental<minIdWindowCalcEnv)
%\texttodo{Bild Prüfling einfügen, vgl. Ausarbeitung Wiederer?}
%\texttodo{Bild Signal Kurbelwellengeber einfügen?}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Rahmenbedingungen für lernfähige \ac{EOL}-Prüfsysteme}
\label{sec:RequirementsAndPotentials}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In diesem Abschnitt werden die Voraussetzungen für den Einsatz lernfähiger \ac{EOL}-Prüfsysteme analysiert und anhand der vorhandenen Beispieldatensätze aus der \ac{EOL}-Prüfung von Verbrennungsmotoren verdeutlicht. Da eine Darstellung aller \num{344} relevanten Prüfmerkmale hinsichtlich jedes behandelten Aspektes den Umfang dieser Arbeit sprengen würde, erfolgt die Analyse anhand ausgewählter Beispielmerkmale welche den jeweiligen Sachverhalt besonders verdeutlichen. Parallel erfolgt eine Analyse zu erwartender Potentiale beim Einsatz lernfähiger Systeme, deren Realisierbarkeit die nachfolgenden Kapitel untersuchen.
%-----------------------------------------------------------------------------
\subsection{Fortlaufende Weiterentwicklung der Prüfgrenzen}
\label{sec:EOLContinuousDevelopment}
%-----------------------------------------------------------------------------
In der realen Großserienproduktion treten regelmäßig Änderungen sowohl an den Produkten als auch am Produktionsprozess einschließlich der Prüfumgebung auf. Beispiele für Änderungen an den Produkten sind im Zusammenhang mit der Motormontage die Einführung neuer Motortypen und die Änderung von Zulieferteilen. Zu beachten ist, dass Optimierungen an den Produkten und deren Herstellung die im Normalbetrieb keine Auswirkungen auf das Produktverhalten haben, sehr wohl erkennbare Veränderungen der Istwerte der Prüfmerkmale in der \ac{EOL}-Prüfung hervorrufen können. Mögliche Änderungen in der Prüfumgebung sind einerseits hardwareseitige Eingriffe in die Prüfstände und deren Messtechnik. Andererseits haben Änderungen am Prüfprogramm über die Anregung des Prüflings direkte Auswirkung auf die Istwerte der Prüfmerkmale (vgl. \figref{fig:schema_signalverarbeitung}).
Veränderungen der Istwerte der Prüfmerkmale führen unabhängig von deren Herkunft aus Produkt- oder Prozessänderungen zu einem Anpassungsbedarf der Prüfgrenzen dieser Merkmale. Dies betrifft manuell gesetzte Prüfgrenzen genauso wie algorithmisch arbeitende, lernfähige Systeme. Es reicht also beim Einsatz eines lernfähigen Prüfalgorithmus nicht aus, Modellparameter und Prüfgrenzen einmalig zu bestimmen und fortan unverändert zu nutzen. Vielmehr müssen die Eigenschaften der Prüflinge regelmäßig neu bestimmt werden. Da ein lernfähiges Prüfsystem diese Aktualisierungen im Idealfall selbsttätig vornehmen kann, entsteht hieraus ein Potential der Arbeitserleichterung gegenüber manuell gesetzten Prüfgrenzen.
%-----------------------------------------------------------------------------
\subsection{Aufteilung in Offline- und Online-Komponenten}
\label{sec:EOLSplit}
%-----------------------------------------------------------------------------
Aufgrund der Integration der \ac{EOL}-Prüfstände in die Produktionslinie und einer Prüfquote von bis zu \SI{100}{\percent} müssen \ac{EOL}-Prüfstände in der Lage sein, die produzierte Menge an Prüflingen innerhalb des Produktionstaktes zu prüfen.
Bei langer Dauer der Prüfläufe (Prüfzeit) ist eine größere Anzahl an \ac{EOL}-Prüfständen erforderlich, was sich in entsprechend höheren Kosten für Investitionen und Betrieb niederschlägt.
Da das Prüfergebnis nach Abschluss des Prüflaufs über den weiteren Transport des Prüflings entscheidet, zählt zur Prüfzeit neben dem eigentlichen Prüflauf auch die erforderliche Zeit für die Bewertung der Messdaten. Aus diesem Grund ist die Prüfzeit möglichst kurz zu halten, und die Auswertung und Bewertung der Messsignale bis zum Prüfergebnis (vgl. \figref{fig:schema_signalverarbeitung}) muss möglichst schnell erfolgen. Eine erst nachträgliche Bewertung z.B. aller Prüflinge eines Produktionsloses ist nicht wünschenswert, da dadurch der Logistikprozess gestört wird - Prüflinge müssten eingelagert werden.
\begin{figure}
\centering
\includegraphics{schema_pruefung}
\caption[Schematischer Aufbau eines lernfähigen \ac{EOL}-Prüfsystems]{Schematischer Aufbau eines lernfähigen \ac{EOL}-Prüfsystems mit Offline-Trainingskomponente und Online-Prüfkomponente}
\label{fig:schema_pruefung}
\end{figure}
% \textfixme{Beim Prüfling Messdaten oder Istwerte erwähnen; Prüfergebnis einzeichnen; Bild umbauen gemäß Skizze für chapter_static}
Im Gegensatz zum linienintegrierten Prüfbetrieb sind Anpassungen am Prüfprogramm inkl. der Prüfgrenzen nicht zeitkritisch. Der Aufbau eines lernfähigen Prüfsystems gliedert sich daher in eine zeitkritische, onlinefähige Prüfkomponente und eine nicht-zeitkritische Offline-Trainingskomponente. \Figref{fig:schema_pruefung} stellt die Komponenten eines lernfähigen \ac{EOL}-Prüfsystems auf dieser Abstraktionsebene dar. Anhand historischer Messdaten aus den Prüfständen und Nutzereinstellungen erzeugt die Trainingskomponente einen Satz an Modellparametern, der als Teil des Prüfprogramms an die Prüfkomponente übermittelt wird. Diese führt die Bewertung der Prüfläufe online aus. Über die ermittelten Messdaten nachfolgender Prüfläufe schließt sich der Kreis zur Trainingskomponente, die mit neuen Messdaten aktualisierte Parametersätze für das Prüfprogramm berechnen kann. Als tolerierbare Dauer der Bewertung in der Online-Prüfkomponente vom Vorhandensein der Merkmals-Istwerte bis zur Ausgabe des Prüfergebnisses wird im Folgenden eine Größenordnung von \SI{1}{s} angenommen. Im Prüfstand steht gewöhnliche PC-Hardware zur Verfügung. Für die Offline-Trainingskomponente wird eine tägliche Aktualisierung der Prüfprogramme als ausreichend angesehen, wobei hier bei Bedarf auf entsprechend leistungsfähigere Serversysteme und eine Parallelisierung der Rechenvorgänge zurückgegriffen werden kann.
Für den Produktionsbetrieb ist neben der Online-Fähigkeit der Prüfkomponente auch ein möglicher temporärer Ausfall der Datenverbindung zwischen Trainings- und Prüfkomponente relevant. Die Prüfkomponente soll also mit Hilfe der Informationen im Prüfprogramm zumindest zeitweilig eigenständig lauffähig sein.
%-----------------------------------------------------------------------------
\subsection{Unterscheidung von Untergruppen in den Messdaten}
\label{sec:EOLDistinguishGroups}
%-----------------------------------------------------------------------------
Wie in \secref{eq:Datasets} dargestellt wurde, sind in den bestehenden Prüfprogrammen der Motorenprüfung teilweise mehrere Motortypen zusammengefasst und verfügen damit auch über die gleichen Prüfgrenzen. Dieser Umstand ist dem Aufwand für die manuelle Pflege der Prüfprogramme geschuldet. Beim Einsatz lernfähiger Systeme in der \ac{EOL}-Prüfung bietet sich die Möglichkeit, solche Untergruppen in den Messdaten aufzugliedern und gesondert zu behandeln und so das Verhalten der Prüflinge genauer zu charakterisieren. Eine weitere Ursache für erkennbare Untergruppen in den Istwerten der Prüfmerkmale ist die Nutzung mehrerer Prüfstände. Da es sich um komplexe mechatronische Systeme handelt treten bauartbedingt und durch unterschiedliche Abnutzung prüfstandsspezifische Unterschiede in den Istwerten auf, die sich auch durch Kalibrierung und Wartung nicht völlig vermeiden lassen. \Figref{fig:unterschiede_pruefstaende_kerndichte} stellt beispielhaft anhand eines Prüfmerkmals die Verteilung der Istwerte an den vier untersuchten Prüfständen gegenüber. Die Istwerte unterscheiden sich hier bezogen auf die jeweilige Streuung deutlich. Die ebenfalls eingezeichneten manuell gesetzten Prüfgrenzen decken einen großen Wertebereich ab, der die Gesamtstreuung über alle Prüfstände hinweg nochmals überschreitet.
\begin{figure}
\centering
\setlength\figurewidth{.9\columnwidth}
\setlength\figureheight{.45\columnwidth}
\renewcommand\figureXLabel{Istwert $y$ des Prüfmerkmals}
\renewcommand\figureYLabel{Kerndichteschätzung für $\pdfBr{\meas}$}
\footnotesize
%\mytikzexton
\input{"graphics/P1015 02(all) 03/001 windowGroup=001, kernel density.tikz"}
\mytikzextoff
\caption[Kerndichteschätzung bei Unterscheidung mehrerer Prüfstände]{Kerndichteschätzung der Wahrscheinlichkeitsdichtefunktion $\pdfBr{\meas}$ für das Prüfmerkmal \num{1} % idWindow = 1
über die vier Prüfstände P1 \lineWithParens{myLineOne}, P2 \lineWithParens{myLineTwo}, P3 \lineWithParens{myLineThree} und P4 \lineWithParens{myLineFour} bei Motortyp M1. Eingetragen sind auch die manuell gesetzten Prüfgrenzen \dashedLineWithParens{myManualLimits}. Verwendet wurden nur Daten von Prüflingen, die bei ihrem ersten Prüflauf ein \ac{iO}-Prüfergebnis gemäß der manuellen Prüfgrenzen erhalten haben.}
\label{fig:unterschiede_pruefstaende_kerndichte}
\end{figure}
Vergleichbar stellt sich die Situation bei Motortypen dar, die heute in einem Prüfprogramm zusammengefasst und damit mit den selben Prüfgrenzen geprüft werden. \Figref{fig:unterschiede_motorvarianten_kerndichte} zeigt die Verteilung der Istwerte der der drei untersuchten Motortypen. Während die Motortypen M1 und M2 ein sehr ähnliches Verhalten aufweisen, weicht M3 in diesem Beispielmerkmal deutlich davon ab. Die manuell gesetzten Prüfgrenzen sind wiederum weiter gesetzt, als es die gemeinsame Streuung über die Motortypen hinweg erwarten lässt.
\begin{figure}
\centering
\setlength\figurewidth{.9\columnwidth}
\setlength\figureheight{.45\columnwidth}
\renewcommand\figureXLabel{Istwert $y$ des Prüfmerkmals}
\renewcommand\figureYLabel{Kerndichteschätzung für $\pdfBr{\meas}$}
\footnotesize
%\mytikzexton
\input{"graphics/P1015 02(all) 04/001 windowGroup=001, kernel density.tikz"}
\mytikzextoff
\caption[Kerndichteschätzung bei Unterscheidung mehrerer Motortypen]{Kerndichteschätzung der Wahrscheinlichkeitsdichtefunktion $\pdfBr{\meas}$ für das Prüfmerkmal \num{48} % idWindow=53
über die drei Motortypen M1 \lineWithParens{myLineOne}, M2 \lineWithParens{myLineTwo} und M3 \lineWithParens{myLineThree} am Prüfstand P2. Eingetragen sind auch die manuell gesetzten Prüfgrenzen \dashedLineWithParens{myManualLimits}. Verwendet wurden nur Daten von Prüflingen, die bei ihrem ersten Prüflauf ein \ac{iO}-Prüfergebnis gemäß der manuellen Prüfgrenzen erhalten haben.}
\label{fig:unterschiede_motorvarianten_kerndichte}
\end{figure}
Als Potential für lernfähige Systeme ergibt sich durch eine feinere Unterscheidung von Untergruppen in den Messdaten eine höhere Prüfschärfe, wenn der Trainingsalgorithmus die Prüfgrenzen auf jede Untergruppe spezifisch angepasst. Problematisch ist dabei die verringerte Anzahl der Prüflinge je Untergruppe. Stehen für den Trainingsvorgang einer Untergruppe nur sehr wenige Motoren zur Verfügung, dann ist die Parameterschätzung im Trainingsvorgang möglicherweise ungenau.
Über die anhand ihrer Herkunft von verschieden Prüfständen und/oder Motortypen zuordenbaren Untergruppen hinaus ist außerdem auffällig, dass in \figref{fig:unterschiede_pruefstaende_kerndichte} die geschätzte Wahrscheinlichkeitsdichte $\pdfBr{\meas}$ für den Motortyp M1 und den Prüfstand P1 zwei lokale Maxima aufweist, d.h. es handelt sich um eine multimodale Verteilung. Eine weitergehende Untersuchung aller Prüfmerkmale zeigt, dass eine solche Aufspaltung von Messdaten des gleichen Prüfstandes und des gleichen Motortyps bei ca. \SI{15}{\percent} der Prüfmerkmale auftritt. \Figref{fig:unterschiede_innerhalb_untergruppe} zeigt ein Merkmal mit ausgeprägter Multimodalität, die sich über alle drei Motortypen vergleichbar verhält. Mögliche Ursachen für multimodale Verteilungen sind z.B. wechselnde (interne oder externe) Lieferanten von Motorbauteilen oder vergleichbare, in der \ac{EOL}-Prüfung nicht bekannte Störfaktoren. Einfache Schätzverfahren wie sie in \chref{ch:basics} vorgestellt wurden sind nicht für stark multimodale Verteilungen geeignet, weshalb dieser Effekt bei den Untersuchungen in den nachfolgenden Kapiteln zu beachten ist.
\begin{figure}
\centering
\setlength\figurewidth{.9\columnwidth}
\setlength\figureheight{.45\columnwidth}
\renewcommand\figureXLabel{Istwert $y$ des Prüfmerkmals}
\renewcommand\figureYLabel{Kerndichteschätzung für $\pdfBr{\meas}$}
\footnotesize
%\mytikzexton
\input{"graphics/P1015 02(all) 04/002 windowGroup=002, kernel density.tikz"}
\mytikzextoff
\caption[Kerndichteschätzung bei unbekannter Herkunft der Untergruppen]{Kerndichteschätzung der Wahrscheinlichkeitsdichtefunktion $\pdfBr{\meas}$ für das Prüfmerkmal \num{239} % idWindow=266
über die drei Motortypen M1 \lineWithParens{myLineOne}, M2 \lineWithParens{myLineTwo} und M3 \lineWithParens{myLineThree} am Prüfstand P2. Eingetragen sind auch die manuell gesetzten Prüfgrenzen \dashedLineWithParens{myManualLimits}. Verwendet wurden nur Daten von Prüflingen, die bei ihrem ersten Prüflauf ein \ac{iO}-Prüfergebnis gemäß der manuellen Prüfgrenzen erhalten haben.}
\label{fig:unterschiede_innerhalb_untergruppe}
\end{figure}
%-----------------------------------------------------------------------------
\subsection{Schiefe der \ac{iO}-Merkmalsverteilungen}
\label{sec:EOLSkewedFeatures}
%-----------------------------------------------------------------------------
Neben der Unimodalität ist eine weitere häufig anzutreffende Modellannahme lernfähiger Algorithmen die annähernde Symmetrie der auftretenden Merkmalsverteilungen. Auch diese Annahme wird von einigen Merkmalen der \ac{EOL}-Prüfung verletzt. \Figref{fig:EOLSkewness} zeigt ein Beispiel mit nur einem Maximum, aber starker Schiefe in $\pdfBr{\meas}$. Häufig treten schiefe Verteilungen bei Luft- und Körperschallmerkmalen auf, da die bewerteten Signalamplituden nur für Werte größer Null physikalisch sinnvoll sind. Wird die Schiefe einer Merkmalsverteilung nicht richtig berücksichtigt, dann können einerseits Annahmen bei der Parameterschätzung verletzt werden. Außerdem werden die unter Annahme von Symmetrie berechneten Prüfgrenzen in den Randbereichen der Verteilung das Verhalten der \ac{iO}-Istwerte nur unzureichend wiedergeben und entweder deutlich zu eng oder zu weit sein.
\begin{figure}
\centering
\setlength\figurewidth{.9\columnwidth}
\setlength\figureheight{.45\columnwidth}
\renewcommand\figureXLabel{Istwert $y$ des Prüfmerkmals}
\renewcommand\figureYLabel{Kerndichteschätzung für $\pdfBr{\meas}$}
\footnotesize
%\mytikzexton
\input{"graphics/P1015 02(all) 05/001 windowGroup=001, kernel density.tikz"}
\mytikzextoff
\caption[Kerndichteschätzung bei einem Merkmal mit Schiefe]{Kerndichteschätzung der Wahrscheinlichkeitsdichtefunktion $\pdfBr{\meas}$ für das Prüfmerkmal \num{311} % idWindow=343
des Motortyps M1 am Prüfstand P2 \lineWithParens{myLineOne}. Eingetragen sind auch die manuell gesetzten Prüfgrenzen \dashedLineWithParens{myManualLimits}. Verwendet wurden nur Daten von Prüflingen, die bei ihrem ersten Prüflauf ein \ac{iO}-Prüfergebnis gemäß der manuellen Prüfgrenzen erhalten haben.}
\label{fig:EOLSkewness}
\end{figure}
%-----------------------------------------------------------------------------
\subsection{Training vorwiegend mit \ac{iO}-Daten und Robustheit gegen falsche Labels}
\label{sec:TrainingiO}
%-----------------------------------------------------------------------------
Wie in \tabref{tab:Dataset} bereits beispielhaft dargestellt wurde, bestehen Datensätze in der \ac{EOL}-Prüfung bei laufender Serienproduktion überwiegend aus \ac{iO}-Prüfläufen. Da \ac{niO}-Prüflinge in der Produktion als unerwünschter, zu minimierender Effekt auftreten kann ein lernfähiges System zu keiner Zeit verlässlich Messdaten aus \ac{niO}-Prüfläufen nutzen. Selbst wenn \ac{niO}-Prüfungen in größerer Zahl vorhanden sein sollten, ist deren Aussagekraft bei Einführung einer neuen Produktvariante u.U. nicht mehr gegeben. Wesentliches Charakteristikum bei der Untersuchung lernfähiger \ac{EOL}-Prüfsysteme ist daher ein sehr starkes Klassenungleichgewicht. Die lernfähige \ac{EOL}-Prüfung kann in diesem Zusammenhang auch als Ein-Klassen-Problem bzw. als Ausreißererkennung interpretiert werden (vgl. \chref{ch:basics}).
Sofern das Training eines lernfähigen Prüfsystems aufgrund der genannten Einschränkung ausschließlich mit \ac{iO}-Daten durchgeführt werden soll, stellt sich die Frage wie diese aus der Gesamtmenge der Messdaten ausgewählt bzw. von den \ac{niO}-Messungen getrennt werden. Soll das Training hingegen sowohl \ac{iO}- als auch \ac{niO}-Daten nutzen, dann sind für den Trainingsalgorithmus in der Regel \ac{iO}-/\ac{niO}-Labels erforderlich. In beiden Fällen stammen die Trainingsdaten wie in \figref{fig:schema_pruefung} dargestellt aus dem laufenden Produktionsprozess, eine verlässliche Zuordnung zur \ac{iO}- bzw. \ac{niO}-Teilmenge ist nicht zu \SI{100}{\percent} garantiert.
Die klassische Herangehensweise für das Erzeugen einer ausreichenden Menge an Trainingsdaten mit verlässlichen Labels ist das manuelle Sichten und kategorisieren der Trainingsdaten. %(\glqq{}Labeln\grqq).
Für die \ac{EOL}-Prüfung würde das bedeuten, dass der Aufwand lediglich von der manuellen Parametrierung von Prüfgrenzen weg und zum Erstellen von Labels für Trainingsdatensätze hin verlagert würde. %Das Erstellen der Labels müsste außerdem für verschiedene Motortypen, Prüfstände, etc. wiederholt werden.
Selbst in diesem Fall ist aber noch mit einer gewissen Quote an falschen Labels in den Trainingsdaten zu rechnen.
Praktisch müssen die verwendeten Algorithmen also mit einem starken Ungleichgewicht zwischen der Anzahl der \ac{iO}- und \ac{niO}-Prüfläufe umgehen können. Zudem müssen sie robust gegenüber einer falschen Zuordnung der Trainingsdaten zur \ac{iO}- bzw. \ac{niO}-Teilmenge sein. In den nachfolgenden Kapitel wird sich zeigen, dass sich beide Aspekte geschickt kombinieren lassen: im Extremfall werden zunächst alle verfügbaren Trainingsdaten als \ac{iO} angenommen und im Trainingsvorgang gegebenenfalls vorhandene \ac{niO}-Prüfläufe aufgrund der Robustheit des Trainingsalgorithmus selbstständig erkannt.
%-----------------------------------------------------------------------------
\subsection{Notwendigkeit der Prüfung aller Prüfmerkmale}
\label{sec:EOLTestAllFeatures}
%-----------------------------------------------------------------------------
Bei der Verwendung lernfähiger Systeme kommen vor dem eigentlichen Training häufig datenbasierte Verfahren zur Dimensionsreduktion des Merkmalsraumes zum Einsatz. Gründe dafür sind die Abwägung zwischen Bias und Varianz der Schätzergebnisse (vgl. \chref{ch:basics}) und die bessere Interpretierbarkeit der Lösung in einem reduzierten Merkmalsraum \cite[][203\psq]{James2013}. Zusätzlich verringert sich der Rechenaufwand und damit die Hardwareanforderungen bzw. die Rechenzeit bei der Realisierung eines lernfähigen Systems, wenn weniger Merkmale verarbeitet werden. Solche Maßnahmen sind zweckmäßig, wenn die Trainingsdaten das in der Anwendung zu erwartende Ein-/Ausgangsverhalten vollständig abdecken. Diese Voraussetzung ist sowohl für Regressions- als auch Klassifikationsprobleme üblicherweise gegeben. Da in der \ac{EOL}-Prüfung aber primär nur Daten von \ac{iO}-Prüflingen für das Training zur Verfügung stehen, kann aus den Trainingsdaten nicht zuverlässig auf das mögliche Verhalten von \ac{niO}-Prüflingen geschlossen werden. Es sind schlicht zu wenige Beobachtungen von \ac{niO}-Prüflingen vorhanden. Darüber hinaus ist die mögliche Vielfalt an denkbaren Fehlerarten, Fehlerausprägungen und Kombinationen mehrerer Fehler in einem \ac{niO}-Prüfling sehr groß. Eine vollständige Abdeckung des \ac{niO}-Bereiches des Merkmalsraumes durch künstliche Fehlereinbauten ist daher nicht praktikabel.
Als Konsequenz ist eine datenbasierte, automatisierte Dimensionsreduktion der Prüfmerkmale durch eine Vorauswahl von Merkmalen nicht zielführend. Es besteht die Gefahr, dass einige Fehler in einem reduzierten Merkmalsraum nicht mehr erkennbar sind und damit vom lerfähigen Prüfsystem nicht gemeldet werden. Die in der Anwendung auftretenden \ac{niO}-Prüflinge müssen außerdem in keiner Weise die Korrelationen der \ac{iO}-Prüflinge aus dem Trainingsdatensatz einhalten. Daher sind auch Projektionen des Merkmalsraums auf Unterräume (z.B. durch PCA) nur dann verlässlich einsetzbar, wenn anschließend alle Unterräume bzw. Komponenten überwacht werden. Entsprechend nutzen PCA-basierte Verfahren der Fehlererkennung in der Regel auch die Komponenten mit geringer Varianz (vgl. Residual Subspace in \cite{Yin2014b}), die eine reine Dimensionsreduktion hingegen ignoriert.
Vereinfacht dargestellt muss ein lernfähiges System nach wie vor alle Merkmale prüfen, die auch mit manuell gesetzten Prüfgrenzen überwacht wurden, da anhand der \ac{iO}-Messdaten kein zuverlässiges Auswählen einer Teilmenge von relevanten Merkmalen möglich ist. Falls die Anzahl der zu prüfenden Merkmale verringert werden soll, dann ist die Einbeziehung von Anwenderwissen empfehlenswert \cite[][397]{Aggarwal2013}.
% \texttodo{Abbildung Scatter-Plot zwei korrelierte Merkmale mit zwei niO-Samples, einmal im Original-Raum, einmal in (reduziertem) PCA-Raum; niO außerhalb der ersten Hauptkomponente wird nicht entdeckt; Beispiel aus Messung?}
%-----------------------------------------------------------------------------
\subsection{Korrelationen zwischen Prüfmerkmalen}
\label{sec:EOLCorrelation}
%-----------------------------------------------------------------------------
Praktisch treten bei der \ac{EOL}-Prüfung von komplexen Prüflingen wie Verbrennungsmotoren Korrelationen zwischen den Istwerten der verschiedenen Prüfmerkmale auf. Die Ursachen dafür liegen sowohl in den physikalischen Zusammenhängen im Prüfling als auch in der Festlegung der Prüfmerkmale. Ein anschauliches Beispiel für physikalisch gekoppelte Prüfmerkmale zeigt \figref{fig:EOLTorque}.
Zu erkennen sind die vier Maxima und vier Minima im Schlepp-Drehmoment, die sich grob der Kompression und Dekompression in den jeweiligen Zylindern eines Vierzylinder-Viertaktmotors zuordnen lassen. Das Arbeitsspiel und damit auch der Signalverlauf des Drehmoment-Signals wiederholt sich alle \SI{720}{\degree}.
Mit den acht eingezeichneten Fenstern wird versucht, das zum Schleppen des Prüflings erforderliche Drehmoment den vier Zylindern zuzuordnen. Der Druck im Saugrohr und am Auslass (vgl. \figref{fig:schema_pruefstand}) hat direkten Einfluss auf die Gaskräfte in den einzelnen Zylindern und wirkt auf alle vier Zylinder gleichermaßen. Über den Gasdruck kommt es so zu einer Kopplung der Istwerte von Prüfmerkmalen des Schlepp-Drehmoments. Den Gaskräften in den Zylindern überlagert sind aber außerdem auch die erforderlichen Drehmomentkomponenten zur Überwindung der Reibung, zum Betrieb der Nebenaggregate und zum Antreiben des Ventiltriebs. Diese Drehmomentkomponenten wirken weitgehend gleichmäßig über das gesamte Arbeitsspiel und resultieren in einer gemeinsamen Verschiebung der Istwerte aller acht Prüfmerkmale. Diese Verschiebung ist für jeden Prüfling individuell und führt ebenfalls zu einer Korrelation der Istwerte dieser Prüfmerkmale.
\begin{figure}
\centering
\setlength\figurewidth{.9\columnwidth}
\setlength\figureheight{.45\columnwidth}
\renewcommand\figureXLabel{Kurbelwinkel \mathSymbolWithUnit{\varphi}{\degree} }
\renewcommand\figureYLabel{Drehmoment \mathSymbolWithUnit{M(\varphi)}{Nm} }
\footnotesize
%\mytikzexton
\input{"graphics/P1211 01/001 idPartType_10021_idChannel_10063_idXAxis_10003.tikz"}
%\input{"graphics/P1211 01/001 idPartType 10021 idChannel 10063 idXAxis 10003.tikz"}
\mytikzextoff
\caption[Messsignale des Schlepp-Drehmoments und manuell definierte Fenster]{Messsignale des Schlepp-Drehmoments \lineWithParens{myLineOne} für \num{25} Motoren des Motortyps M1 mit \ac{iO}-Prüfergebnis auf dem Prüfstand P2 sowie acht der manuell definierten Fenster \dashedLineWithParens{myManualLimits} mit Nummer des Merkmals und Merkmalstyp (vgl. \tabref{tab:Auswertefunktionen}). Die Signale stammen aus der Mechanik-Teilprüfung (vgl. \figref{fig:drehzahlverlauf_pruefung}). Das bei $\varphi = \SI{695}{\degree}$ beginnende Fenster des Merkmals \num{84} bricht am Signalende um und umfasst weiters den Bereich $\varphi \in \bracks{\SI{0}{\degree}, \SI{10}{\degree}}$.}
\label{fig:EOLTorque}
\end{figure}
%Bin 5 of 189:
% idWindow idPartType idChannel idXAxis windowType cylinder lowerLimit upperLimit xMin xMax actualValue limitExceeded property1Name property1Value property2Name property2Value property3Name property3Value isScalar isContinuous partTypeName yName xName windowBin
% 88 10021 10063 10003 'Max' NaN [ 41] [ 84] 335 370 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
% 83 10021 10063 10003 'Min' NaN [ -50] [ -10] 20 55 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
% 84 10021 10063 10003 'Min' NaN [ -50] [ -10] 200 235 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
% 85 10021 10063 10003 'Min' NaN [ -50] [ -10] 380 415 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
% 86 10021 10063 10003 'Min' NaN [ -50] [ -10] 560 595 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
% 90 10021 10063 10003 'Max' NaN [ 41] [ 84] 695 10 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
% 89 10021 10063 10003 'Max' NaN [ 41] [ 84] 515 550 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
% 103 10021 10066 10003 'Mitt' NaN [-650] [-250] 5 715 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Ansaugdruck [mbar]' 'KW [°]' 35
% 87 10021 10063 10003 'Max' NaN [ 41] [ 84] 155 190 [NaN] NaN '' [NaN] '' [NaN] '' [NaN] true true 'Mechanik, Mechanik' 'Drehmoment [Nm]' 'KW [°]' 35
Über den gesamten Prüfling hinweg betrachtet sind die Zusammenhänge zwischen den einzelnen Prüfmerkmalen sehr komplex. Sie hängen zudem von den Aktor-Eingriffen in den jeweiligen Teilprüfungen ab, die genaue Ausprägung ist unter anderem auch abhängig vom konkreten Motortyp. Eine Stichproben-Korrelationsmatrix aller \num{326} stetigen Prüfmerkmale zeigt \figref{fig:EOLCorrelation}. Dabei weist sowohl eine stark positive als auch eine stark negative Korrelation auf einen Zusammenhang der Istwerte der jeweiligen Merkmale hin. Das Korrelationsverhalten gilt dabei aber ausdrücklich nur für die \ac{iO}-Prüflinge. Es sei nochmals darauf hingewiesen, dass eine starke Korrelation der Istwerte zweier Merkmale im \ac{iO}-Fall keinesfalls darauf schließen lässt, dass eines der beiden Merkmale für die Fehlererkennung nicht erforderlich sei. Beispielhaft lässt sich dies an den acht Prüfmerkmalen nachvollziehen, deren Istwerte aus den Fenstern in \figref{fig:EOLTorque} berechnet werden. Sie finden sich in der Stichproben-Korrelationsmatrix in \figref{fig:EOLCorrelation} als Block von acht stark korrelierten Merkmalen an den Positionen \num{77} bis \num{84} wieder, wobei die ersten vier Merkmale zu den letzten vier negativ korreliert sind. Trotz der starken Korrelation der acht Merkmale im \ac{iO}-Fall ist keines der Merkmale verzichtbar, da jedes die Kompression bzw. Dekompression in einem der vier Zylinder des Prüflings überwacht.
\begin{figure}
\centering
\footnotesize
\setlength\figurewidth{.5923\columnwidth} % factor 1.1846 larger than figureheight
\setlength\figureheight{.5\columnwidth}
\renewcommand\figureXLabel{Index der Prüfmerkmale}
\renewcommand\figureYLabel{Index der Prüfmerkmale}
\includegraphics{"P1015 02(all) 01a/001 windowGroup=001, correlation matrix"}
\caption[Stichproben-Korrelationsmatrix aller Prüfmerkmale]{Stichproben-Korrelationsmatrix der \num{326} stetigen Prüfmerkmale für Motortyp M1 am Prüfstand P2. An den Zeilen und Spalten sind jeweils die Prüfmerkmale durchnummeriert. Stark eingefärbte Merkmalspaare weisen eine hohe (positive oder negative) Korrelation der Istwerte auf, graue Merkmalspaare sind nahezu unkorreliert. Verwendet wurden nur Daten von Prüflingen, die bei ihrem ersten Prüflauf ein \ac{iO}-Prüfergebnis gemäß der manuellen Prüfgrenzen erhalten haben.}
\label{fig:EOLCorrelation}
\end{figure}
Wenn also auch eine Reduktion der Anzahl auszuwertender Prüfmerkmale anhand der Korrelationen nicht sinnvoll ist, lassen sich die bekannten Zusammenhänge im \ac{iO}-Fall unter Umständen nutzen, um davon abweichende \ac{niO}-Prüfläufe zu erkennen. Durch das gemeinsame Bewerten mehrerer Prüfmerkmale besteht das Potential einer schärferen Fehlererkennung. Zur Veranschaulichung sind in \figref{fig:EOLScatterTorque} zwei der Drehmoment-Prüfmerkmale aus \figref{fig:EOLTorque} gegeneinander aufgetragen. Wie anhand der Korrelationsmatrix bereits zu erkennen war, besteht zwischen den Istwerten der beiden Merkmale eine starke positive Korrelation. Wird jedes der beiden Merkmale für sich betrachtet, dann ist die resultierende Gesamt-Prüfgrenze im zweidimensionalen Merkmalsraum ein Rechteck (vgl. manuelle Prüfgrenzen). Die tatsächliche Verteilung der \ac{iO}-Merkmalswerte füllt nur einen kleinen Teil der innenliegenden, als \ac{iO}-bewerteten Fläche des Merkmalsraumes aus. Durch eine bessere Anpassung der Prüfgrenze an die reale mehrdimensionale Verteilung der \ac{iO}-Prüfläufe besteht also das Potential eine schärfere Fehlererkennung zu erreichen. Der durch die achsparallelen, manuell gesetzten Prüfgrenzen definierte Hyperquader wird in diesem Fall durch eine komplexe, mehrdimensionale geometrische Form ersetzt.
\begin{figure}
\centering
\footnotesize
\setlength\figurewidth{.5923\columnwidth} % factor 1.1846 larger than figureheight
\setlength\figureheight{.5\columnwidth}
\renewcommand\figureXLabel{Prüfmerkmal \num{77}}
\renewcommand\figureYLabel{Prüfmerkmal \num{78}}
\includegraphics{"P1015 02(all) 02b/001 windowGroup=001, scatter"}
\caption[Streudiagramm zweier Prüfmerkmale des Schlepp-Drehmoments]{Streudiagramm als Gegenüberstellung der Istwerte der Prüfmerkmale \num{77} und \num{78} \circleWithParens{myY} für Motortyp M1 mit auf dem Prüfstand P2 sowie manuelle gesetzte Prüfgrenzen der beiden Merkmale \mbox{\dashedLineWithParens{myManualLimits}.} Verwendet wurden nur Daten von Prüflingen, die bei ihrem ersten Prüflauf ein \ac{iO}-Prüfergebnis gemäß der manuellen Prüfgrenzen erhalten haben.}
\label{fig:EOLScatterTorque}
\end{figure}
Herausfordernd ist die Übertragung auf höherdimensionale Merkmalsräume, da sich sowohl die Bestimmung und Darstellung der resultierenden Prüfgrenze als auch die Interpretation der Prüfergebnisse mit der Anzahl der miteinander verknüpften Merkmale zunehmend schwieriger gestaltet.
Es stellt sich daher die Frage, wie sich Prüfmerkmale anhand ihrer Istwerte sinnvoll in korrelierte Teilräume gruppieren lassen. In der Korrelationsmatrix entspricht dies einem Umordnen der Zeilen und Spalten, so dass Blöcke von Merkmalen mit starker Korrelation auftreten. Eine einfache Möglichkeit um eine solche Gruppierung zu erreichen ist der Aufbau eines Graphen aus der Stichproben-Korrelationsmatrix. Der Betrag des Stichproben-Korrelationskoeffizienten $\corrSym_{\indexFeat,\indexFeatTwo}$ von Merkmal $\indexFeat$ und Merkmal $\indexFeatTwo$ wird dazu mit einem unteren Schwellwert $\adjacency_0$ versehen:
\begin{IEEEeqnarray}{rCl}
\adjacency_{\indexFeat,\indexFeatTwo} &=& \begin{cases}
1 & \text{für} \abs{\corrSym_{\indexFeat,\indexFeatTwo}} > \adjacency_0, \\
0 & \text{sonst.}
\end{cases} \label{eq:EOLAdjacencyElement}
\end{IEEEeqnarray}
%
Aus den Werten $\adjacency_{\indexFeat,\indexFeatTwo}$ wird die Adjazenzmatrix eines Graphen aufgebaut, wobei $\adjacency_{\indexFeat,\indexFeatTwo}$ den Eintrag in der $\indexFeat$-ten Zeile und $\indexFeatTwo$-ten Spalte der Adjazenzmatrix darstellt. Diese Vorgehensweise ist ähnlich zum Ausgangspunkt der Spectral-Clustering-Methode \cite[][544-547]{Hastie2009}, es werden allerdings die Ähnlichkeiten zwischen ganzen Merkmalen und nicht zwischen einzelnen Samples betrachtet. Den so entstehenden Graphen zeigt \figref{fig:EOLGraph}. Jeder Knoten stellt ein Prüfmerkmal dar, und die vorhandenen Kanten zeigen eine starke Korrelationen zwischen den jeweiligen Prüfmerkmalen auf. Der Schwellwert in \eqref{eq:EOLAdjacencyElement} entscheidet über den Mindestwert des (absoluten) Korrelationskoeffizienten für die Darstellung einer Kante im Graphen. Beispielhaft für das Ergebnis der Gruppierung sind die Prüfmerkmale des Drehmomentsignals aus \figref{fig:EOLTorque}. Alle acht Merkmale wurden im Graphen in \figref{fig:EOLGraph} rein basierend auf den analysierten Messdaten gemeinsam in Gruppe B eingeordnet. Außerdem enthält Gruppe B noch Merkmal 97, % idWindow=103
das den Mittelwert des Ansaugdrucks bewertet und damit ebenfalls mit dem Schlepp-Drehmoment in physikalischem Zusammenhang steht. Die anderen Merkmalsgruppen führen ebenfalls Merkmale zusammen, die physikalisch miteinander zusammenhängende Phänomene abbilden. %Die Merkmalsgruppen N und O gruppieren z.B. Merkmale des Drehmomentes, allerdings aus der Teilprüfung \glqq{}Öldruckaufbau\grqq (vgl. \figref{fig:drehzahlverlauf_pruefung}).
\begin{figure}
\centering
\includegraphics{"correlation graph, mod4"}
% EC1015_DriftPlotFeatureDrift svg export, open with Inkscape, ungroup, remove unneccessary background rectangles, check edge line with is 0.75 pt, export as pdf
\caption[Graph zur Korrelationsstruktur der Prüfmerkmale]{Graph zur Darstellung der Korrelationsstruktur der Prüfmerkmale mit einem Knoten je Prüfmerkmal und Kanten entsprechend einer Adjazenzmatrix $\mm{A}$ mit Einträgen $a_{i,j}$ aus \eqref{eq:EOLAdjacencyElement} und Schwellwert $a_0 = \num{0.8}$. Verwendet wurden Messungen des Motortyps M1 am Prüfstand P2 mit \ac{iO}-Prüfergebnis gemäß der manuellen Prüfgrenzen.}
\label{fig:EOLGraph}
\end{figure}
%\texttodo{Jetzt könnte man die Korrelationsmatrix wieder auspacken, und Gruppen von Merkmalen mit je einer eigenen Farbe einfärben}
Untersuchungen zu Prüfverfahren mit mehrdimensionalen Prüfgrenzen finden sich in \chref{ch:static}. Dort wird auch die Aufteilung der Prüfmerkmal in korrelierte Gruppen genutzt.
%-----------------------------------------------------------------------------
\subsection{Interpretierbarkeit und Eingriffsmöglichkeiten}
\label{sec:EOLInterpretation}
%-----------------------------------------------------------------------------
Ein Vorteil manueller Prüfgrenzen ist deren einfache Interpretierbarkeit: für jedes Merkmal gibt es eine eindeutige, feststehende untere und obere Grenze. Ein lernfähiges Prüfsystem ist zwangsläufig komplexer und damit potentiell schwieriger zu verstehen. Die Interpretierbarkeit ist dabei einerseits wichtig, damit die Bediener dem System vertrauen können. Andererseits unterstützt eine gute Interpretierbarkeit Verbesserungen im Falle von Fehlfunktionen. Interpretierbarkeit betrifft hier das Verhalten bei verschiedenen Eingangsdaten (gegebenenfalls mit Verletzung der Modellannahmen) und Nutzereingaben. Weiters betroffen ist die Darstellung der Ergebnisse in Form der Prüfgrenze und der Prüfergebnisse. Die Darstellung der Prüfergebnisse ist besonders wichtig bei \ac{niO}-Prüfläufen, um eine Aussage über die betroffenen Prüfmerkmale machen zu können.
Ist die Prüfgrenze bzw. das Prüfergebnis eines lernfähigen Prüfsystems nicht zufriedenstellend, dann sind entsprechende Eingriffsmöglichkeiten in die Algorithmen erforderlich um das Verhalten zu verbessern. Konkret gilt dies z.B. für die Prüfschärfe der einzelnen Merkmale und des Prüfsystems als Ganzes. Der zu prüfende Qualitätsaspekt der Produkte ist hier durchaus relativ zu sehen: zwischen einem nicht korrekt funktionierenden und damit eindeutig als \ac{niO} zu bewertenden Prüfling und einem in jeder Hinsicht perfekten \glqq{}Referenzmuster\grqq{} liegt eine ganze Bandbreite an funktionierenden, aber vom gewünschten Idealverhalten abweichenden Ausprägungen. Solche geringfügigen Abweichungen sind dem Produktionsprozess immanent und lassen sich nie ganz vermeiden. Wann jedoch ein funktionierender, vom Ideal abweichender Prüfling als nicht mehr tolerierbar anzusehen ist hängt im Grenzbereich auch vom Hersteller und dessen Qualitätsansprüchen ab, die entsprechend in die Prüfgrenzen einfließen sollten.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Zusammenfassung}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Zusammenfassend stellt die \ac{EOL}-Prüfung von Fahrzeugmotoren ein komplexes Anwendungsbeispiel dar, anhand dessen in den nachfolgenden Kapiteln lernfähige Prüfsysteme untersucht werden. Eine in die Fertigungslinie integrierte \ac{EOL}-Prüfung bedingt eine Aufteilung des Prüfsystems in eine Online-Prüfkomponente und eine Offline-Trainingskomponente. Die Vielzahl an Prüfmerkmalen (326 relevante Merkmale in den untersuchten Beispieldatensätzen) und deren jeweilige statistische Besonderheiten stellen eine Herausforderung für die verwendeten Algorithmen dar. Bei der Verknüpfung mehrerer Prüfmerkmale miteinander besteht das Potential, eine höhere Prüfschärfe zu erreichen. Ebenso entsteht ein Potential für engere Prüfgrenzen durch eine feineren Unterscheidung von Produktvarianten. Als Rahmenbedingungen sind außerdem die Eigenschaften der Prüfumgebung (unter anderem in Form verschiedener Prüfstände) zu berücksichtigen, die sich in den Istwerten der Prüfmerkmale niederschlagen. Eine Robustheit gegenüber fehlerhaften Trainingsdatensätzen ist vorteilhaft, um ein manuelles Aufbereiten von Trainingsdatensätzen zu vermeiden und so einen möglichst autonomen Betrieb eines lernfähigen Prüfsystems zu ermöglichen.

343
01_tex/chapters/chapter_stuff.tex

@ -0,0 +1,343 @@ @@ -0,0 +1,343 @@
\chap{Test Chapter}
\label{ch:00_xxx}
Templates, Tests, Rests
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{ToDo's}
\label{sec:0001_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{itemize}
\item Nomeclature + Macros + Symbols with heads + Tabel Format (Emily Fox)
\item All compiling
\item Fast compiling
\item Bibliography
\item Kopf- bzw. Fußzeile bei:
\begin{itemize}
\item Notational Conventions
\item Acronyms and Abbreviations
\item Contents
\item List of Figures
\item List of Tables
\item Bibliography
\item MAIN Part ...
\end{itemize}
\end{itemize}
Afterwards
\begin{itemize}
\item \textfixme{Declaration?}
\item \textfixme{Titelseite anpassen} % nach Vorbild Dötlinger
\item \textfixme{Bisher keine Links bei refs auf Subfigures (subcaptionbox in chapter static Varianten Normalisierung)}
\item \texttodo{Spacing in Math Mode aus The Not so Short Introduction to Latex 2e}
\item \textfixme{Umbrüche / zu lange Zeilen / Hyphenation prüfen}
\item \textfixme{Prüfen: überall log (englisch) statt ln (deutsch)?}
\end{itemize}
\vspace{1cm}
Ganz zum Schluss, in dieser Reihenfolge:
\begin{enumerate}
\item Literaturverzeichnis prüfen
\item Text nach ?? durchsuchen
\item Boxen prüfen
\item Worttrennung / Umbrüche prüfen
\item Platzierung von Algorithmen prüfen
\item Literatur ausdrucken
\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Notes}
\label{sec:0002_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Notizen:
\begin{itemize}
\item
\item
\item
\item
\item
\item
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{FixMe}
\label{sec:0003_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{itemize}
\item \texttodo{To Do}
\item \textfixme{Fix me}
\item \fixme{Fix me - no text}
\item \textcaution{Caution}
\item \textinfo{Info}
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Cite}
\label{sec:0004_xxx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{itemize}
\item \cite{Kuipers.2000}
\item \cite[][]{Boor.1972}
\item \cite[][14]{Waldron.2016}
\item \cite[][491]{Biagiotti.2008}
\item \cite[][31\psq]{Biagiotti.2008}
\item \cite[][411-417]{Dahlquist.2008}
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Glossaries}
\label{sec:Glossaries}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Glossaries (GLS)
\begin{itemize}
\item \gls{acr:MSE}
% \item $\gls{raumpunkt}$
\item \glspl{acr:iid}
%\item \glsentryshortpl{acr:rw}
%\item \glsentryshort{acr:dh}
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Reference}
\label{sec:Reference}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{tabular}{ll}
\tabitem Appendix: & \text{\textbackslash appref\{app:xxx\}}\\
\tabitem Tabular: & \text{\textbackslash tabref\{tab:xxx\}}\\
\tabitem Equation: & \text{\textbackslash eqref\{eq:xxx\}}\\
\tabitem Figure: & \text{\textbackslash figref\{fig:xxx\}}\\
\end{tabular}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Macros}
\label{sec:Macros}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%==============================================================================
\subsection{Equations}
\label{subsec:Equations}
%==============================================================================
\begin{eqnarray}
a^2 + b^2 = 7 c^2\\
\mv{y} = \mm{A} \mv{x}
\end{eqnarray}
\begin{IEEEeqnarray}{rCl}
\IEEEyesnumber\label{eq:basicsrotation}\IEEEyessubnumber*
\matfun[x]{R}{\theta}&=&\mrbegin{3}{1& 0& 0\\0& \cosBr{\theta}& -\sinBr{\theta}\\0& \sinBr{\theta}& \cosBr{\theta}}\label{eq:basicsrotationx}\\
\matfun[z]{R}{\theta}&=&\mrbegin{3}{\cosBr{\theta}& -\sinBr{\theta}& 0\\\sinBr{\theta}& \cosBr{\theta}& 0\\0& 0& 1}\label{eq:basicsrotationz}
\end{IEEEeqnarray}
\simpleeq{{}^{A'}\matfun[A]{R}{\mv{\xi}}&=&\matfun[z]{R}{\phi}\matfun[x']{R}{\vartheta}\matfun[z'']{R}{\psi}=\mrbegin{3}{{}_{A}\mv{e}_x & {}_{A}\mv{e}_y & {}_{A}\mv{e}_z}\label{eq:basicseuler}}
%==============================================================================
\subsection{Function}
\label{subsec:function}
%==============================================================================
Maktros ...
${}_{O}{\mv{r}}\in\dimR{3}$ und ${}_{A}{\mv{r}}\in\dimR{3}$,
$\matfun[x]{R}{\theta}$, $\matfun[y]{R}{\theta}$ und $\matfun[z]{R}{\theta}$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Table}
\label{sec:Table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[H]
\centering
\caption{Bla Bla}
\footnotesize
\label{tab:basicsdhparameter}
\begin{tabularx}{\textwidth}{@{}YYYYY}
\toprule
DH-Parameter & $\theta$ $\SI{}{[\radian]}$ & $d$ $\SI{}{[\mm]}$ & $a$ $\SI{}{[\mm]}$ & $\alpha$ $\SI{}{[\radian]}$\\
\midrule
Basis & 0 & $40$ & 0 & 0 \\ % k ok, d ok
Achse 1 & $q_1$ & $0$ & $l_1$ & 0 \\
Achse 2 & $q_2$ & $0$ & $l_2$ & 0 \\
Achse 3 & 0 & $q_3-40$ & 0 & 0 \\
Achse 4 & $q_4$ & $0$ & xxx & $-\nicefrac{\pi}{2}$ \\
Achse 5 & $q_5$ & $0$ & xxx & 0 \\
\bottomrule
\end{tabularx}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Figures}
\label{sec:Figures}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{figure}[''placement specifier'']
% Specifier Permission
% h Place the float here, i.e., approximately at the same point it occurs in the source text (however, not exactly at the spot)
% t Position at the top of the page.
% b Position at the bottom of the page.
% p Put on a special page for floats only.
% ! Override internal parameters LaTeX uses for determining "good" float positions.
% H Places the float at precisely the location in the LaTeX code. Requires the float package (\usepackage{float}). This is somewhat equivalent to h!,
% though some errors may arise if you have too many consecutive floats with [H]
\begin{figure}[H]
\centering
\setlength\figurewidth{0.83\columnwidth}
\setlength\figureheight{0.3\columnwidth}
\mytikzexton
\input{"figures/tikz/fitnessNWSA.tex"}
%\mytikzextoff
\caption{Testplot}
\end{figure}
\begin{figure}
\centering
\setlength\figurewidth{0.6\textwidth}
\setlength\figureheight{0.4\textwidth}
\renewcommand\figureXLabel{u}% \mathSymbolWithUnit{\varphi}{\degree} }
\renewcommand\figureYLabel{$f\parens*{u}$}% \mathSymbolWithUnit{M(\varphi)}{Nm} }
\footnotesize
\mytikzexton
%\mytikzextoff
\input{"figures/tikz/plot_Interpolation_Polynom.tex"}
%\input{"graphics/P1211 01/001 idPartType 10021 idChannel 10063 idXAxis 10003.tikz"}
%\mytikzextoff
\caption[Polynominterpolynom und Runge-Phänomen]{Funktion $f\parens*{u}=\frac{1}{25u^2+1}$ \lineWithParens{black} und deren Polynominterpolation nach ; Polynom vom Grad $\nu=4$ \dashedLineWithParens{myLineOne}, Grad $\nu=6$ \dashedLineWithParens{myLineTwo}, Grad $\nu=8$ \dashedLineWithParens{myLineThree} und Grad $\nu=10$ \dashedLineWithParens{myLineFour}, sowie eine kubische Splineinterpolation \dashDotLineWithParens{myLineFive} durch 10 Segmente}
\label{fig:basicsinterpolationpolynom}
\end{figure}
\tikzsetnextfilename{extBasisfunktionen0}
\begin{figure}
\centering
\subcaptionbox{Basisfunktionen nullten Grades}{
\footnotesize{
\setlength\figurewidth{0.9\textwidth}
\setlength\figureheight{0.2\textwidth}
%\tikzexternalenable
\input{"figures/tikz/plot_Basisfunktionen0.tex"}
\tikzexternaldisable}%
\label{fig:basicsbasisfunktionen0}}
\subcaptionbox{Basisfunktionen ersten Grades}{
\footnotesize{
\setlength\figurewidth{0.9\textwidth}
\setlength\figureheight{0.2\textwidth}
\tikzsetnextfilename{extBasisfunktionen1}
%\tikzexternalenable
\input{"figures/tikz/plot_Basisfunktionen1.tex"}
\tikzexternaldisable}%
\label{fig:basicsbasisfunktionen1}}
\subcaptionbox{Basisfunktionen zweiten Grades}{
\footnotesize{
\setlength\figurewidth{0.9\textwidth}
\setlength\figureheight{0.2\textwidth}
\tikzsetnextfilename{extBasisfunktionen2}
%\tikzexternalenable
\input{"figures/tikz/plot_Basisfunktionen2.tex"}
\tikzexternaldisable}%
\label{fig:basicsbasisfunktionen2}}
\caption[Basisfunktionen eines B-Splines]{Basisfunktionen definiert mit dem Knotenvektor}
\label{fig:basicsbasisfunktionen}
\end{figure}
\begin{figure}
\centering
\tikz{ %
% Define nodes
\node[obs] (y) {$y_{i}^{(j)}$};
\node[obs, right=of y] (f) {$f_{ik}^{(j)}$};
\factor[above=of y,yshift=0.7cm] {yf} {Multi} {} {} ; %
\factor[above=of f,yshift=0.7cm] {rf} {Cat} {} {} ;
\node[latent, left=of yf] (pi) {$\pi_{c}^{(j)}$};
\node[latent, above=of pi, yshift=0.5cm] (beta) {$\beta_{c}^{(j)}$};
\factor[above=of pi, yshift=0.4cm] {pi-f} {left:Dir} {} {} ; %
\node[latent, above=of yf, xshift=0.8cm, yshift=3cm ] (t) {$t_i$};
\node[latent, above=of t, yshift=0.5cm] (p) {$p$};
\node[latent, right=of p, xshift=0.8cm] (alpha) {$\alpha$};
\factor[above=of t, yshift=0.5cm] {t-f} {left:Beta} {} {} ; %
\factor[right=of p, xshift=0.5cm] {p-f} {Dir} {} {} ; %
\node[latent, right=of rf] (d) {$z_{k,c}^{(i)}$};
\node[latent, above=of d, yshift=0.5cm] (gamma) {$\gamma_{0,c}^{(i)}$};
\factor[above=of d, yshift=0.4cm] {d-f} {right:Dir} {} {} ; %
% Connect the nodes
\edge {y} {f} ;
\factoredge {gamma} {d-f} {d} ;
\factoredge {alpha} {p-f} {p}; %
\factoredge {p} {t-f} {t}; %
\factoredge {beta} {pi-f} {pi} ;
\factoredge {pi} {yf} {y} ;
\factoredge {d} {rf} {f} ;
\gate {y-gate} {(yf)(yf-caption)} {t}
\gate {f-gate} {(rf)(rf-caption)} {t}
% Plates
\plate [inner sep=0.3cm, xshift=0.1cm, yshift=-0.2cm,color=red] {pA} {(f)(rf)(d)(d-f)} {$k \in K_i$}; %
{\tikzset{plate caption/.append style={above=5pt of #1.north west}}
\plate [inner sep=0.3cm, xshift=0.2cm, color=blue] {pC} {(beta)(pi)(d)(gamma)} {C classes};}
{\tikzset{plate caption/.append style={above=5pt of #1.north east}}
\plate [inner sep=0.7cm, xshift=0.3cm, yshift=-0.4cm, color=brown] {pT} {(t)(gamma)(d)(yf)(y)(rf)(f)} {N objects};}
{\tikzset{plate caption/.append style={above=5pt of #1.south west}}
\plate [inner sep=0.2cm, xshift=-0.2cm] {pM} {(beta)(pi)(yf)(y)(rf)(f)} {M workers} ;}
\plate [inner sep=0.2cm, xshift=-0.05cm, yshift=0.15cm] {pJi} {(y)(f)} {$J_i$}
}
\end{figure}
\blindtext
\Blindtext
\blinddocument
\Blinddocument
\blindtext[5]
\blindlist{description}[5]
\blinditemize
\blindenumerate
\blinddescription
\blindenumerate[10]
\blindmathtrue
\blindtext[2]
\blindmathfalse
\blindmathpaper

2382
01_tex/chapters/chapter_time_series.tex

File diff suppressed because it is too large Load Diff

3
01_tex/chapters/d01_appendix.tex

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
% appendix 1
\chapter{Appendix}
\label{app:01_xxx}

14
01_tex/figures/00_matlab_fcn/legendflex/.gitignore vendored

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
# OS generated files
#-------------------
*.DS_Store
*.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
# Package extras
#---------------
legendflex/legendflexDoc.m

20
01_tex/figures/00_matlab_fcn/legendflex/LICENSE.txt

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2015 Kelly Kearney
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

521
01_tex/figures/00_matlab_fcn/legendflex/README.html

File diff suppressed because one or more lines are too long

352
01_tex/figures/00_matlab_fcn/legendflex/README.m

@ -0,0 +1,352 @@ @@ -0,0 +1,352 @@
%% |legendflex.m|: a more flexible, customizable legend
% Author: Kelly Kearney
%
% This repository includes the code for the |legendflex.m| Matlab function,
% along with all dependent functions required to run it.
%
% This function offers a more flexible version of the legend command. It
% offers a different method of positioning the legend, as well as options
% to:
%
% * organize legend text and symbols in a grid with a specified number of
% rows and/or columns
% * rescale the horizontal space used by each legend symbol
% * create multiple legends for the same axis
% * add a title to the legend within the legend box
%
% This function should support all types of plot objects.
%
% *Legend positioning*
%
% Unlike in the default legend command, where the legend is positioned
% relative to the labeled objects' parent axis according to one of 16
% location strings, this function positions the legend based on two anchor
% points (one on either the figure or a child object of a figure, and one
% on the legend itself) and a buffer (or offset) between these two anchor
% points. The anchor points refer to the corners and centers of each
% side of the box surrounding the reference object and the legend itself;
% they can be refered to either as numbers (1-8, clockwise from northwest
% corner) or strings ('nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'). The
% position of the legend is determined by these two points and the distance
% between them, defined in the 'buffer' variable, which by default is
% measured in pixels. So the combination of
%
% (..., 'ref', gca, 'anchor', [3 3], 'buffer', [-10 -10])
%
% means that you want the northeast corner of the current axis to be
% aligned with the northeast corner of the legend, but with the legend
% shifted 10 pixels to the left and down.
%
% This method of positioning can be particularly useful when labeling a
% figure that includes many subplots that share a common color scheme,
% where the "best" location for a legend is not necessarily within the
% bounds of an axis. Unlike the legend command, the axes in the figure are
% never resized (and it is up to the user to check that the legend fits on
% the figure in the specified location). In addition to being easier than
% manually positioning a legend, this function updates the legend location
% when the figure is resized, preserving the desired alignment. The
% following anchor/buffer combinations, when used with the default
% reference and a buffer unit of pixels, approximately replicate the
% typical legend locations:
%
% Specifier Anchor Buffer
%
% north [2 2] [ 0 -10]
% south [6 6] [ 0 10]
% east [4 4] [-10 0]
% west [8 8] [ 10 0]
% northeast [3 3] [-10 -10]
% northwest [1 1] [ 10 -10]
% southeast [5 5] [-10 10]
% southwest [7 7] [ 10 10]
% northoutside* [2 6] [ 0 10]
% southoutside* [6 2] [ 0 -10]
% eastoutside* [3 8] [ 10 0]
% westoutside* [8 3] [-10 0]
% northeastoutside* [3 1] [ 10 0]
% northwestoutside* [1 3] [-10 0]
% southeastoutside* [5 7] [ 10 0]
% southwestoutside* [7 5] [-10 0]
%
% *placed outside axis rather than resizing plot box
%
%% Getting started
%
% *Prerequisites*
%
% This function requires Matlab R14 or later.
%
% *Downloading and installation*
%
% This code can be downloaded from <https://github.com/kakearney/legendflex-pkg/ Github>
% or the
% <http://www.mathworks.com/matlabcentral/fileexchange/31092
% MatlabCentral File Exchange>. The File Exchange entry is updated daily
% from the GitHub repository.
%
% *Matlab Search Path*
%
% The following folders need to be added to your Matlab Search path (via
% |addpath|, |pathtool|, etc.):
%
% legendflex-pkg/legendflex
% legendflex-pkg/setgetpos_V1.2
%% Syntax
%
% legendflex(M, param1, val1, ...)
% legendflex(h, M, param1, val1, ...)
% [legend_h,object_h,plot_h,text_str] = legendflex(...)
%
% Input variables:
%
% * |M|: cell array of strings, labels for legend
% * |h|: handle of axis or handle(s) of object(s) to be labeled. If
% this is an axis handle, all children of the axis will be
% included in the legend. If not included, current axis is
% used.
%
% Optional input variables (passed as parameter/value pairs): [default]
%
% * |ncol|: number of columns, or 0 to indicate as many as necessary
% given the # of labeled objects [1 if nrow is 0, 0
% otherwise]
% * |nrow|: number of rows, or 0 to indicate as many as necessary
% given the # of labeled objects [0]
% * |ref|: handle of object used to position the legend. This can be
% either a figure or a child object of a figure (and does not
% need to relate in any way to the objects being labeled).
% If not included, the reference will be to the axis that a
% normal legend would be associated with (usually the parent
% axis of the labeled objects, unless objects from multiple
% axes are passed, in which case it's the parent object of
% the first labeled object).
% * |anchor|: 1 x 2 array specifying which points of the reference object
% and new legend, respectively, to anchor to each other.
% Anchor points can be described using either numbers (in a 1
% x 2 double array) or directional strings (in a 1 x 2 cell
% array) as follows:
% 1 = 'nw' = upper left corner,
% 2 = 'n' = center of top edge,
% 3 = 'ne' = upper right corner,
% 4 = 'e' = center of right edge,
% 5 = 'se' = bottom right corner,
% 6 = 's' = center of bottom edge,
% 7 = 'sw' = bottom left corner,
% 8 = 'w' = center of left edge,
% [[3 3], i.e. {'ne' 'ne'}]
% * |buffer|: 1 x 2 array of horizontal and vertical distance,
% respectively, from the reference anchor point to the legend
% anchor point. Distance is measured in units specified by
% bufferunit. [[-10 -10]]
% * |bufferunit|: unit for buffer distance. Note that this property only
% affects the units used to position the legend, not the
% units for the legend itself (which is always a fixed size,
% based on the space needed to encapsulate the specified
% symbols and text). The 'normalized' units are normalized
% to size of the figure. ['pixels']
% * |box|: 'on' or 'off', specifies whether to enclose legend objects
% in a box ['on']
% * |xscale|: scalar value indicating scale factor to apply to the width
% required by each symbol, relative to the size used by
% legend. For example, 0.5 will shorten the lines/patches by
% half. [1]
% * |title|: A title string to be added inside the legend box, centered,
% above all legend entries. This can be either a string or a
% cell array of strings; the latter will produce a multi-line
% title. If empty, no title is added. ['']
% * |padding|: 1 x 3 array, pixel spacing added to beginning of each
% column (before symbol), between symbol and text, and after
% text, respectively. Usually, the default provides the
% spacing typical of a regular legend, but occassionally the
% extent properties wrap a little too close to text, making
% things look crowded; in these cases you can try unsquishing
% (or squishing, via use of negative values) things via this
% parameter. [2 1 1]
% * |nolisten|: logical scalar. If true, don't add the event listeners.
% The event listeners update the legend objects when you
% change a property of the labeled objects (such as line
% style, color, etc.). However, the updating requires the
% legend to be redrawn, which can really slow things down,
% especially if you're labelling lots of objects that get
% changed together (if you change the line width of 100
% labeled lines, the legend gets redrawn 100 times). In more
% recent releases, this also occurs when printing to file, so
% I recommend setting this to true if you plan to print a
% legend with a large number of labeled objects. The legend
% will still be redrawn on figure resize regardless of the
% value of this parameter. [false]
%
% In addition to these legendflex-specific parameters, this function will
% accept any parameter accepted by the original legend function (e.g.
% font properties) except 'location', 'boxon', 'boxoff', or 'hide'.
%
% Output variables:
%
% * |legend_h|: handle of the legend axis. It is not linked to an axis or
% graphics objects in the same way as a Matlab legend.
% However, on figure resize, all properties of the legend
% objects are checked for changes, so adjusting the figure
% size can re-link the legend to the labeled objects after
% you have made changes to those objects.
% * |object_h|: handles of the line, patch, and text graphics objects
% created in the legend
% * |plot_h|: handles of the lines and other objects labeled in this
% legend
% * |text_str|: cell array of the text strings used in the legend
%% Examples
%
% First, let's create a subplot with 10 lines, 5 solid and 5 dashed, which
% cycle through 5 colors:
figure('color','w');
for iax = 1:3
ax(iax) = subplot(2,2,iax);
end
linespec = [repmat({'r';'b';'g';'c';'m'},2,1), ...
[repmat({'-'}, 5, 1); repmat({'--'}, 5, 1)]];
x = [0 10];
y = (1:10)'*x;
lbl = cellstr(num2str((1:10)'));
hln(:,1) = plot(ax(1), x, y);
set(hln(:,1), {'color','linestyle'}, linespec);
%%
% Now add a legend in the upper left corner, with the entries arranged in a
% 4 x 3 grid so it doesn't interfere with the data. We've also decreased
% the horizontal space used by each legend line:
[hl(1).leg, hl(1).obj, hl(1).hout, hl(1).mout] = ...
legendflex(hln(:,1), lbl, 'anchor', {'nw','nw'}, ...
'buffer', [5 -5], ...
'ncol', 3, ...
'fontsize', 8, ...
'xscale', 0.8, ...
'box', 'off');
%%
% Plot the same lines in the second subplot. But this time, let's add two
% legends: one for color, and one for line style. Note that in this case,
% the second legend is positioned relative to the first, rather than
% relative to the axis itself:
hln(:,2) = plot(ax(2), x, y);
set(hln(:,2), {'color','linestyle'}, linespec);
[hl(2).leg, hl(2).obj, hl(2).hout, hl(2).mout] = ...
legendflex(hln(1:5,2), lbl(1:5), ...
'anchor', {'nw','nw'}, ...
'buffer', [5 -5], ...
'fontsize',8, ...
'xscale',0.5, ...
'title', 'Color');
[hl(3).leg, hl(3).obj, hl(3).hout, hl(3).mout] = ...
legendflex(hln([1 6],2), {'thing 1', 'thing 2'}, ...
'ref', hl(2).leg, ...
'anchor', {'ne','nw'}, ...
'buffer', [0 0], ...
'fontsize', 8', ...
'title', 'Line');
%%
% Our final subplot simply shows that this function will handle all object
% types. We plot a |contourf| plot overlaid with a |quiver| plot, and
% label both above the subplot axis.
%
% _Well, almost any graphics object. In 2014b, there are some rendering
% bugs when legend is called with multiple outputs that can cause weird
% stuff to happen when labeling contour objects; these sorts of issues may
% continue as the Mathworks updates their graphics further._
[X,Y] = meshgrid(-2:.2:2);
Z = X.*exp(-X.^2 - Y.^2);
[DX,DY] = gradient(Z,.2,.2);
axes(ax(3));
hold on;
[c,hcont] = contourf(X,Y,Z);
hquiv = quiver(X,Y,DX,DY);
[hl(4).leg, hl(4).obj, hl(4).hout, hl(4).mout] = ...
legendflex([hcont hquiv], {'contour', 'quiver'}, ...
'anchor',{'ne','se'}, ...
'buffer',[0, 0.01], ...
'bufferunit', 'normalized');
%% A note on legendflex with LateX
%
% Unfortunately, the Latex renderer doesn't play very nicely with
% legendflex. It's something that bugs me in my own work too, but I've
% never been able to come up with a good workaround that would position
% things properly. The legendflex function repositions everything using
% the 'Extent' property of all the text in the original legend. However,
% the extent property of latex-rendered text doesn't always match up with
% the actual space taken up by the text... not quite sure why this is, and
% therefore I don't have a reliable way to calculate what that real space
% is.
%
% Here's an example using plain text objects. Ideally, the red boxes would
% surround each text object, but in the Latex case, the Extent often leaves
% space above or below, or practically overlaps the text.
figure;
lax(1) = subplot(2,1,1);
lax(2) = subplot(2,1,2);
txt = {'Data 1', '$\frac{1}{2}$', '$var_{ij}^{k}$'};
nt = length(txt);
na = length(lax);
set(lax, 'xlim', [0 nt+1], 'ylim', [0 nt+1]);
for ii = 1:na
ht(ii,:) = text(1:nt,1:nt,txt, 'parent', lax(ii), ...
'interpreter', 'none', ...
'fontsize', 14);
end
set(ht(2,:), 'interpreter', 'latex');
for ii = 1:na
for it = 1:nt
ex = get(ht(ii,it), 'extent');
rectangle('position', ex, 'parent', lax(ii), 'edgecolor', 'r');
end
end
%%
% Becuase of this, you really need to play around with properties (like padding) in order
% to get a legendflex legend that uses latex and looks decent. Sometimes
% generating the legend first, then setting the latex rendering afterwards
% will help a bit. Other times I generate the legend using a larger font
% size, then shrink the text back down after it's been positioned. None of
% these hacks are ideal, but they're the best I've been able to come up
% with.
%% Contributions
%
% Community contributions to this package are welcome!
%
% To report bugs, please submit
% <https://github.com/kakearney/legendflex-pkg/issues an issue> on GitHub and
% include:
%
% * your operating system
% * your version of Matlab and all relevant toolboxes (type |ver| at the Matlab command line to get this info)
% * code/data to reproduce the error or buggy behavior, and the full text of any error messages received
%
% Please also feel free to submit enhancement requests, or to send pull
% requests (via GitHub) for bug fixes or new features.
%
% I do monitor the MatlabCentral FileExchange entry for any issues raised
% in the comments, but would prefer to track issues on GitHub.
%

324
01_tex/figures/00_matlab_fcn/legendflex/README.md

@ -0,0 +1,324 @@ @@ -0,0 +1,324 @@
# legendflex.m: a more flexible, customizable legend
Author: Kelly Kearney
This repository includes the code for the `legendflex.m` Matlab function, along with all dependent functions required to run it.
This function offers a more flexible version of the legend command. It offers a different method of positioning the legend, as well as options to:
- organize legend text and symbols in a grid with a specified number of rows and/or columns
- rescale the horizontal space used by each legend symbol
- create multiple legends for the same axis
- add a title to the legend within the legend box
This function should support all types of plot objects.
**Legend positioning**
Unlike in the default legend command, where the legend is positioned relative to the labeled objects' parent axis according to one of 16 location strings, this function positions the legend based on two anchor points (one on either the figure or a child object of a figure, and one on the legend itself) and a buffer (or offset) between these two anchor points. The anchor points refer to the corners and centers of each side of the box surrounding the reference object and the legend itself; they can be refered to either as numbers (1-8, clockwise from northwest corner) or strings ('nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'). The position of the legend is determined by these two points and the distance between them, defined in the 'buffer' variable, which by default is measured in pixels. So the combination of
```matlab
(..., 'ref', gca, 'anchor', [3 3], 'buffer', [-10 -10])
```
means that you want the northeast corner of the current axis to be aligned with the northeast corner of the legend, but with the legend shifted 10 pixels to the left and down.
This method of positioning can be particularly useful when labeling a figure that includes many subplots that share a common color scheme, where the "best" location for a legend is not necessarily within the bounds of an axis. Unlike the legend command, the axes in the figure are never resized (and it is up to the user to check that the legend fits on the figure in the specified location). In addition to being easier than manually positioning a legend, this function updates the legend location when the figure is resized, preserving the desired alignment. The following anchor/buffer combinations, when used with the default reference and a buffer unit of pixels, approximately replicate the typical legend locations:
```
Specifier Anchor Buffer
```
```
north [2 2] [ 0 -10]
south [6 6] [ 0 10]
east [4 4] [-10 0]
west [8 8] [ 10 0]
northeast [3 3] [-10 -10]
northwest [1 1] [ 10 -10]
southeast [5 5] [-10 10]
southwest [7 7] [ 10 10]
northoutside* [2 6] [ 0 10]
southoutside* [6 2] [ 0 -10]
eastoutside* [3 8] [ 10 0]
westoutside* [8 3] [-10 0]
northeastoutside* [3 1] [ 10 0]
northwestoutside* [1 3] [-10 0]
southeastoutside* [5 7] [ 10 0]
southwestoutside* [7 5] [-10 0]
```
```
*placed outside axis rather than resizing plot box
```
## Contents
- Getting started
- Syntax
- Examples
- A note on legendflex with LateX
- Contributions
## Getting started
**Prerequisites**
This function requires Matlab R14 or later.
**Downloading and installation**
This code can be downloaded from [Github](https://github.com/kakearney/legendflex-pkg/) or the [MatlabCentral File Exchange](http://www.mathworks.com/matlabcentral/fileexchange/31092). The File Exchange entry is updated daily from the GitHub repository.
**Matlab Search Path**
The following folders need to be added to your Matlab Search path (via `addpath`, `pathtool`, etc.):
```matlab
legendflex-pkg/legendflex
legendflex-pkg/setgetpos_V1.2
```
## Syntax
```
legendflex(M, param1, val1, ...)
legendflex(h, M, param1, val1, ...)
[legend_h,object_h,plot_h,text_str] = legendflex(...)
```
Input variables:
- `M`: cell array of strings, labels for legend
- `h`: handle of axis or handle(s) of object(s) to be labeled. If this is an axis handle, all children of the axis will be included in the legend. If not included, current axis is used.
Optional input variables (passed as parameter/value pairs): [default]
- `ncol`: number of columns, or 0 to indicate as many as necessary given the # of labeled objects [1 if nrow is 0, 0 otherwise]
- `nrow`: number of rows, or 0 to indicate as many as necessary given the # of labeled objects [0]
- `ref`: handle of object used to position the legend. This can be either a figure or a child object of a figure (and does not need to relate in any way to the objects being labeled). If not included, the reference will be to the axis that a normal legend would be associated with (usually the parent axis of the labeled objects, unless objects from multiple axes are passed, in which case it's the parent object of the first labeled object).
- `anchor`: 1 x 2 array specifying which points of the reference object and new legend, respectively, to anchor to each other. Anchor points can be described using either numbers (in a 1 x 2 double array) or directional strings (in a 1 x 2 cell array) as follows: 1 = 'nw' = upper left corner, 2 = 'n' = center of top edge, 3 = 'ne' = upper right corner, 4 = 'e' = center of right edge, 5 = 'se' = bottom right corner, 6 = 's' = center of bottom edge, 7 = 'sw' = bottom left corner, 8 = 'w' = center of left edge, [[3 3], i.e. {'ne' 'ne'}]
- `buffer`: 1 x 2 array of horizontal and vertical distance, respectively, from the reference anchor point to the legend anchor point. Distance is measured in units specified by bufferunit. [[-10 -10]]
- `bufferunit`: unit for buffer distance. Note that this property only affects the units used to position the legend, not the units for the legend itself (which is always a fixed size, based on the space needed to encapsulate the specified symbols and text). The 'normalized' units are normalized to size of the figure. ['pixels']
- `box`: 'on' or 'off', specifies whether to enclose legend objects in a box ['on']
- `xscale`: scalar value indicating scale factor to apply to the width required by each symbol, relative to the size used by legend. For example, 0.5 will shorten the lines/patches by half. [1]
- `title`: A title string to be added inside the legend box, centered, above all legend entries. This can be either a string or a cell array of strings; the latter will produce a multi-line title. If empty, no title is added. ['']
- `padding`: 1 x 3 array, pixel spacing added to beginning of each column (before symbol), between symbol and text, and after text, respectively. Usually, the default provides the spacing typical of a regular legend, but occassionally the extent properties wrap a little too close to text, making things look crowded; in these cases you can try unsquishing (or squishing, via use of negative values) things via this parameter. [2 1 1]
- `nolisten`: logical scalar. If true, don't add the event listeners. The event listeners update the legend objects when you change a property of the labeled objects (such as line style, color, etc.). However, the updating requires the legend to be redrawn, which can really slow things down, especially if you're labelling lots of objects that get changed together (if you change the line width of 100 labeled lines, the legend gets redrawn 100 times). In more recent releases, this also occurs when printing to file, so I recommend setting this to true if you plan to print a legend with a large number of labeled objects. The legend will still be redrawn on figure resize regardless of the value of this parameter. [false]
In addition to these legendflex-specific parameters, this function will accept any parameter accepted by the original legend function (e.g. font properties) except 'location', 'boxon', 'boxoff', or 'hide'.
Output variables:
- `legend_h`: handle of the legend axis. It is not linked to an axis or graphics objects in the same way as a Matlab legend. However, on figure resize, all properties of the legend objects are checked for changes, so adjusting the figure size can re-link the legend to the labeled objects after you have made changes to those objects.
- `object_h`: handles of the line, patch, and text graphics objects created in the legend
- `plot_h`: handles of the lines and other objects labeled in this legend
- `text_str`: cell array of the text strings used in the legend
## Examples
First, let's create a subplot with 10 lines, 5 solid and 5 dashed, which cycle through 5 colors:
```matlab
figure('color','w');
for iax = 1:3
ax(iax) = subplot(2,2,iax);
end
linespec = [repmat({'r';'b';'g';'c';'m'},2,1), ...
[repmat({'-'}, 5, 1); repmat({'--'}, 5, 1)]];
x = [0 10];
y = (1:10)'*x;
lbl = cellstr(num2str((1:10)'));
hln(:,1) = plot(ax(1), x, y);
set(hln(:,1), {'color','linestyle'}, linespec);
```
![](./readmeExtras/README_01.png)
Now add a legend in the upper left corner, with the entries arranged in a 4 x 3 grid so it doesn't interfere with the data. We've also decreased the horizontal space used by each legend line:
```matlab
[hl(1).leg, hl(1).obj, hl(1).hout, hl(1).mout] = ...
legendflex(hln(:,1), lbl, 'anchor', {'nw','nw'}, ...
'buffer', [5 -5], ...
'ncol', 3, ...
'fontsize', 8, ...
'xscale', 0.8, ...
'box', 'off');
```
![](./readmeExtras/README_02.png)
Plot the same lines in the second subplot. But this time, let's add two legends: one for color, and one for line style. Note that in this case, the second legend is positioned relative to the first, rather than relative to the axis itself:
```matlab
hln(:,2) = plot(ax(2), x, y);
set(hln(:,2), {'color','linestyle'}, linespec);
[hl(2).leg, hl(2).obj, hl(2).hout, hl(2).mout] = ...
legendflex(hln(1:5,2), lbl(1:5), ...
'anchor', {'nw','nw'}, ...
'buffer', [5 -5], ...
'fontsize',8, ...
'xscale',0.5, ...
'title', 'Color');
[hl(3).leg, hl(3).obj, hl(3).hout, hl(3).mout] = ...
legendflex(hln([1 6],2), {'thing 1', 'thing 2'}, ...
'ref', hl(2).leg, ...
'anchor', {'ne','nw'}, ...
'buffer', [0 0], ...
'fontsize', 8', ...
'title', 'Line');
```
![](./readmeExtras/README_03.png)
Our final subplot simply shows that this function will handle all object types. We plot a `contourf` plot overlaid with a `quiver` plot, and label both above the subplot axis.
*Well, almost any graphics object. In 2014b, there are some rendering bugs when legend is called with multiple outputs that can cause weird stuff to happen when labeling contour objects; these sorts of issues may continue as the Mathworks updates their graphics further.*
```matlab
[X,Y] = meshgrid(-2:.2:2);
Z = X.*exp(-X.^2 - Y.^2);
[DX,DY] = gradient(Z,.2,.2);
axes(ax(3));
hold on;
[c,hcont] = contourf(X,Y,Z);
hquiv = quiver(X,Y,DX,DY);
[hl(4).leg, hl(4).obj, hl(4).hout, hl(4).mout] = ...
legendflex([hcont hquiv], {'contour', 'quiver'}, ...
'anchor',{'ne','se'}, ...
'buffer',[0, 0.01], ...
'bufferunit', 'normalized');
```
![](./readmeExtras/README_04.png)
## A note on legendflex with LateX
Unfortunately, the Latex renderer doesn't play very nicely with legendflex. It's something that bugs me in my own work too, but I've never been able to come up with a good workaround that would position things properly. The legendflex function repositions everything using the 'Extent' property of all the text in the original legend. However, the extent property of latex-rendered text doesn't always match up with the actual space taken up by the text... not quite sure why this is, and therefore I don't have a reliable way to calculate what that real space is.
Here's an example using plain text objects. Ideally, the red boxes would surround each text object, but in the Latex case, the Extent often leaves space above or below, or practically overlaps the text.
```matlab
figure;
lax(1) = subplot(2,1,1);
lax(2) = subplot(2,1,2);
txt = {'Data 1', '$\frac{1}{2}$', '$var_{ij}^{k}$'};
nt = length(txt);
na = length(lax);
set(lax, 'xlim', [0 nt+1], 'ylim', [0 nt+1]);
for ii = 1:na
ht(ii,:) = text(1:nt,1:nt,txt, 'parent', lax(ii), ...
'interpreter', 'none', ...
'fontsize', 14);
end
set(ht(2,:), 'interpreter', 'latex');
for ii = 1:na
for it = 1:nt
ex = get(ht(ii,it), 'extent');
rectangle('position', ex, 'parent', lax(ii), 'edgecolor', 'r');
end
end
```
![](./readmeExtras/README_05.png)
Becuase of this, you really need to play around with properties (like padding) in order to get a legendflex legend that uses latex and looks decent. Sometimes generating the legend first, then setting the latex rendering afterwards will help a bit. Other times I generate the legend using a larger font size, then shrink the text back down after it's been positioned. None of these hacks are ideal, but they're the best I've been able to come up with.
## Contributions
Community contributions to this package are welcome!
To report bugs, please submit [an issue](https://github.com/kakearney/legendflex-pkg/issues) on GitHub and include:
- your operating system
- your version of Matlab and all relevant toolboxes (type `ver` at the Matlab command line to get this info)
- code/data to reproduce the error or buggy behavior, and the full text of any error messages received
Please also feel free to submit enhancement requests, or to send pull requests (via GitHub) for bug fixes or new features.
I do monitor the MatlabCentral FileExchange entry for any issues raised in the comments, but would prefer to track issues on GitHub.
<sub>[Published with MATLAB R2016a]("http://www.mathworks.com/products/matlab/")</sub>

37
01_tex/figures/00_matlab_fcn/legendflex/legendflex/.gitignore vendored

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

912
01_tex/figures/00_matlab_fcn/legendflex/legendflex/legendflex.m

@ -0,0 +1,912 @@ @@ -0,0 +1,912 @@
function varargout = legendflex(varargin)
%LEGENDFLEX Creates a more flexible legend
%
% legendflex(M, param1, val1, ...)
% legendflex(h, M, param1, val1, ...)
% [legend_h,object_h,plot_h,text_str] = legendflex(...)
%
% This offers a more flexible version of the legend command. It offers a
% different method of positioning the legend, as well as options to:
%
% - organize legend text and symbols in a grid with a specified number of
% rows and/or columns
% - rescale the horizontal space used by each legend symbol
% - create multiple legends for the same axis
% - add a title to the legend within the legend box
%
% Unlike in the default legend command, where the legend is positioned
% relative to the labeled objects' parent axis according to one of 16
% location strings, this function positions the legend based on two anchor
% points (one on either the figure or a child object of a figure, and one
% on the legend itself) and a buffer (or offset) between these two anchor
% points. The anchor points refer to the corners and centers of each
% side of the box surrounding the reference object and the legend itself;
% they can be refered to either as numbers (1-8, clockwise from northwest
% corner) or strings ('nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'). The
% position of the legend is determined by these two points and the distance
% between them, defined in the 'buffer' variable, which by default is
% measured in pixels. So the combination of
%
% (..., 'ref', gca, 'anchor', [3 3], 'buffer', [-10 -10])
%
% means that you want the northeast corner of the current axis to be
% aligned with the northeast corner of the legend, but with the legend
% shifted 10 pixels to the left and down.
%
% This method of positioning can be particularly useful when labeling a
% figure that includes many subplots that share a common color scheme,
% where the "best" location for a legend is not necessarily within the
% bounds of an axis. Unlike the legend command, the axes in the figure are
% never resized (and it is up to the user to check that the legend fits on
% the figure in the specified location). In addition to being easier than
% manually positioning a legend, this function updates the legend location
% when the figure is resized, preserving the desired alignment. The
% following anchor/buffer combinations, when used with the default
% reference and a buffer unit of pixels, approximately replicate the
% typical legend locations:
%
% Specifier Anchor Buffer
%
% north [2 2] [ 0 -10]
% south [6 6] [ 0 10]
% east [4 4] [-10 0]
% west [8 8] [ 10 0]
% northeast [3 3] [-10 -10]
% northwest [1 1] [ 10 -10]
% southeast [5 5] [-10 10]
% southwest [7 7] [ 10 10]
% northoutside* [2 6] [ 0 10]
% southoutside* [6 2] [ 0 -10]
% eastoutside* [3 8] [ 10 0]
% westoutside* [8 3] [-10 0]
% northeastoutside* [3 1] [ 10 0]
% northwestoutside* [1 3] [-10 0]
% southeastoutside* [5 7] [ 10 0]
% southwestoutside* [7 5] [-10 0] *placed outside axis rather
% than resizing plot box
%
% This function should support all types of plot objects.
%
% Updates to labeled line and patch properties should be reflected in the
% legend. In pre-R2014b versions of Matlab (those that use the old
% non-object graphics handles), properties of more complex legend labels,
% such as contours, quivers, bars, etc.) will also be synced to the legend;
% however, at this time, the code doesn't update properties for anything
% other than lines and patches in R2014b+ (haven't found a good way to
% listen for changes to the properties of the other graphics object types).
%
% A note on resizing: This function assigns a resize function to the parent
% figure to maintain the position of the legend (in terms of anchor
% location and buffer) as the figure size changes. If you manually resize
% the legend, this function will respect changes to height, width, and
% units (though I don't recommend changing the units to 'normalized', as
% this can cause the text and symbols to overflow the legend box on
% resize). It will not respect manual repositioning when resizing, since
% it assumes you want to maintain the anchor/buffer prescription used to
% create it. Overall, I've tried to make this resize as unobtrusive as
% possible; if your figure already has a resize function at the time you
% apply it, that behavior is inherited, with the legend-resize called
% afterward. If you plan to further modify the figure's resize function
% post-legendflex and want to maintain repositioning of the legends,
% retrieve the resize function via hfun = get(hfig, 'ResizeFcn'), pass it
% to the new resize function, and invoke it via feval(oldfun, h, ed), where
% h and ed are the default variables passed by a callback function.
%
% Input variables:
%
% M: cell array of strings, labels for legend
%
% h: handle of axis or handle(s) of object(s) to be labeled. If
% this is an axis handle, all children of the axis will be
% included in the legend. If not included, current axis is
% used.
%
% Optional input variables (passed as parameter/value pairs): [default]
%
% ncol: number of columns, or 0 to indicate as many as necessary
% given the # of labeled objects [1 if nrow is 0, 0
% otherwise]
%
% nrow: number of rows, or 0 to indicate as many as necessary
% given the # of labeled objects [0]
%
% ref: handle of object used to position the legend. This can be
% either a figure or a child object of a figure (and does not
% need to relate in any way to the objects being labeled).
% If not included, the reference will be to the axis that a
% normal legend would be associated with (usually the parent
% axis of the labeled objects, unless objects from multiple
% axes are passed, in which case it's the parent object of
% the first labeled object).
%
% anchor: 1 x 2 array specifying which points of the reference object
% and new legend, respectively, to anchor to each other.
% Anchor points can be described using either numbers (in a 1
% x 2 double array) or directional strings (in a 1 x 2 cell
% array) as follows:
% 1: 'nw' upper left corner
% 2: 'n' center of top edge
% 3: 'ne' upper right corner
% 4: 'e' center of right edge
% 5: 'se' bottom right corner
% 6: 's' center of bottom edge
% 7: 'sw' bottom left corner
% 8: 'w' center of left edge
%
% [[3 3], i.e. {'ne' 'ne'}]
%
% buffer: 1 x 2 array of horizontal and vertical distance,
% respectively, from the reference anchor point to the legend
% anchor point. Distance is measured in units specified by
% bufferunit. [[-10 -10]]
%
% bufferunit: unit for buffer distance. Note that this property only
% affects the units used to position the legend, not the
% units for the legend itself (which is always a fixed size,
% based on the space needed to encapsulate the specified
% symbols and text). The 'normalized' units are normalized
% to size of the figure. ['pixels']
%
% box: 'on' or 'off', specifies whether to enclose legend objects
% in a box ['on']
%
% xscale: scalar value indicating scale factor to apply to the width
% required by each symbol, relative to the size used by
% legend. For example, 0.5 will shorten the lines/patches by
% half. [1]
%
% title: A title string to be added inside the legend box, centered,
% above all legend entries. This can be either a string or a
% cell array of strings; the latter will produce a multi-line
% title. If empty, no title is added. ['']
%
% padding: 1 x 3 array, pixel spacing added to beginning of each
% column (before symbol), between symbol and text, and after
% text, respectively. Usually, the default provides the
% spacing typical of a regular legend, but occassionally the
% extent properties wrap a little too close to text, making
% things look crowded; in these cases you can try unsquishing
% (or squishing, via use of negative values) things via this
% parameter. [2 1 1]
%
% nolisten: logical scalar. If true, don't add the event listeners.
% The event listeners update the legend objects when you
% change a property of the labeled objects (such as line
% style, color, etc.). However, the updating requires the
% legend to be redrawn, which can really slow things down,
% especially if you're labelling lots of objects that get
% changed together (if you change the line width of 100
% labeled lines, the legend gets redrawn 100 times). In more
% recent releases, this also occurs when printing to file, so
% I recommend setting this to true if you plan to print a
% legend with a large number of labeled objects. The legend
% will still be redrawn on figure resize regardless of the
% value of this parameter. [false]
%
% In addition to these legendflex-specific parameters, this function will
% accept any parameter accepted by the original legend function (e.g.
% font properties) except 'location', 'boxon', 'boxoff', or 'hide'.
%
% Output variables:
%
% legend_h: handle of the legend axis. It is not linked to an axis or
% graphics objects in the same way as a Matlab legend.
% However, on figure resize, all properties of the legend
% objects are checked for changes, so adjusting the figure
% size can re-link the legend to the labeled objects after
% you have made changes to those objects.
%
% object_h: handles of the line, patch, and text graphics objects
% created in the legend
%
% plot_h: handles of the lines and other objects labeled in this
% legend
%
% text_str: cell array of the text strings used in the legend
%
%
% Example:
%
% % Replicating an example from legend.m:
%
% figure;
% b = bar(rand(10,5),'stacked'); colormap(summer); hold on
% x = plot(1:10,5*rand(10,1),'marker','square','markersize',12,...
% 'markeredgecolor','y','markerfacecolor',[.6 0 .6],...
% 'linestyle','-','color','r','linewidth',2); hold off
% lbl = {'Carrots','Peas','Peppers','Green Beans','Cucumbers','Eggplant'};
%
% % Rather than covering up data or resizing the axis, let's squeeze the
% % legend into the margin at the top of the figure;
%
% legendflex([b,x], lbl, 'ref', gcf, ...
% 'anchor', {'n','n'}, ...
% 'buffer',[0 0], ...
% 'nrow',2, ...
% 'fontsize',8);
% Copyright 2011-2014 Kelly Kearney
% Detemine whether HG2 is in use
hg2flag = ~verLessThan('matlab', '8.4.0');
r2016aflag = ~verLessThan('matlab', '9.0.0');
r2013bflag = ~verLessThan('matlab', '8.2.0');
%-------------------
% Parse input
%-------------------
%
% allinput = varargin; % Save for callback later
%
% islegin = false(size(varargin));
% First inputs must be either:
% (M, ...)
% (h, M, ...)
narginchk(1,Inf);
% Split input into the variables that will be passed to legend (handles and
% labels) and everything else
handlepassed = all(ishandle(varargin{1})); % for HG1/HG2
iscellstr = @(x) cellfun(@(y) ischar(y), x); % For now...
% iscellstr = @(x) cellfun(...
% @(y) ischar(y) || (iscell(y) && all(cellfun(@ischar,y))), x); % for multi-line?
if handlepassed
legin = varargin(1:2);
if ~iscell(legin{2}) || ~all(iscellstr(legin{2}))
error('Legend labels must be a cell array of strings');
end
pv = varargin(3:end);
else
legin = varargin(1);
if ~iscell(legin{1}) || ~all(iscellstr(legin{1}))
if isnumeric(legin{1})
error('Unable to parse input 1; check that handle(s) exist');
else
error('Legend labels must be a cell array of strings');
end
end
pv = varargin(2:end);
end
% Parse my optional properties
if hg2flag
defref = gobjects(0);
else
defref = NaN;
end
if r2013bflag
addParamMethod = 'addParameter';
else
addParamMethod = 'addParamValue';
end
p = inputParser;
p.(addParamMethod)('xscale', 1, @(x) validateattributes(x, {'numeric'}, {'nonnegative','scalar'}));
p.(addParamMethod)('ncol', 0, @(x) validateattributes(x, {'numeric'}, {'scalar', 'integer'}));
p.(addParamMethod)('nrow', 0, @(x) validateattributes(x, {'numeric'}, {'scalar', 'integer'}));
p.(addParamMethod)('ref', defref, @(x) validateattributes(x, {'numeric','handle'}, {'scalar'}));
p.(addParamMethod)('anchor', [3 3], @(x) validateattributes(x, {'numeric','cell'}, {'size', [1 2]}));
p.(addParamMethod)('buffer', [-10 -10], @(x) validateattributes(x, {'numeric'}, {'size', [1 2]}));
p.(addParamMethod)('bufferunit', 'pixels', @(x) validateattributes(x, {'char'}, {}));
p.(addParamMethod)('box', 'on', @(x) validateattributes(x, {'char'}, {}));
p.(addParamMethod)('title', '', @(x) validateattributes(x, {'char','cell'}, {}));
p.(addParamMethod)('padding', [2 1 1], @(x) validateattributes(x, {'numeric'}, {'size', [1 3]})); % 'nonnegative'
p.(addParamMethod)('nolisten', false, @(x) validateattributes(x, {'logical'}, {'scalar'}));
p.KeepUnmatched = true;
p.parse(pv{:});
Opt = p.Results;
% Any parameters that don't match mine are assumed to be a legend property.
% If not, legend will handle the error when I call it.
Extra = p.Unmatched;
extra = [fieldnames(Extra) struct2cell(Extra)];
extra = extra';
% Validate that units and box inputs are correct
validatestring(Opt.bufferunit, {'pixels','normalized','inches','centimeters','points','characters'}, 'legendflex', 'bufferunit');
validatestring(Opt.box, {'on', 'off'}, 'legendflex', 'box');
% Translate anchor strings to numbers, if necessary
if iscell(Opt.anchor)
[blah, Opt.anchor] = ismember(Opt.anchor, {'nw','n','ne','e','se','s','sw','w'});
if ~all(blah)
error('Anchor must be 1 x 2 cell array of strings: n, e, s, w, ne, nw, se, sw');
end
else
validateattributes(Opt.anchor, {'numeric'}, {'integer', '<=', 8}, 'legendflex', 'anchor');
end
% Create a temporary legend to get all the objects
S = warning('off', 'MATLAB:legend:PlotEmpty');
if r2016aflag
% The new legend objects are pretty opaque... even diving into the
% undocumented properties, I haven't been able to find the handles of
% the legend sub-components (lines, text, etc). So I need to stick to
% the legacy version, which creates an axis object rather than legend
% object. Legacy version has bug in text properties parsing, though, so
% need to work around that too: use the new-style legend object to get
% proper text properties, then use those to alter the buggy old-style
% legend.
tmp = legend(legin{:}, extra{:}, 'location', 'northeast');
textProps = {'FontAngle','FontName','FontSize','FontUnits','FontWeight','Interpreter'};
tprop = get(tmp, textProps);
delete(tmp);
wtmp = warning('off', 'MATLAB:handle_graphics:exceptions:SceneNode'); % silence Latex interpreter thing
[h.leg, h.obj, h.labeledobj, h.textstr] = legend(legin{:}, extra{:}, 'location', 'northeast');
warning(wtmp);
nobj = length(h.labeledobj);
for it = 1:length(textProps)
set(h.obj(1:nobj), textProps{it}, tprop{it});
end
else
[h.leg, h.obj, h.labeledobj, h.textstr] = legend(legin{:}, extra{:}, 'location', 'northeast');
nobj = length(h.labeledobj);
end
warning(S);
if nobj == 0
warning('Plot empty; no legend created');
return
end
% There's a bug in R2014b-R2015a that causes rendering issues if a contour
% object is included in a legend and legend is called with more than one
% output. For some reason, the rendering issues disappear only if the
% contour object(s) is listed last in the legend. So for now, my
% workaround for this is to change the order of the legend labels as
% necessary. Issue appears to be fixed in 2015b.
iscont = strcmp(get(h.labeledobj, 'type'), 'contour');
cbugflag = ~verLessThan('matlab', '8.4.0') && verLessThan('matlab', '8.6.0') && any(iscont);
if cbugflag
if length(legin) == 1
legin = {h.labeledobj legin{1}};
end
delete(h.leg);
[srt, isrt] = sort(iscont);
legin{1} = legin{1}(isrt);
legin{2} = legin{2}(isrt);
[h.leg, h.obj, h.labeledobj, h.textstr] = legend(legin{:}, extra{:}, 'location', 'northeast');
end
% # rows and columns
if (Opt.ncol == 0) && (Opt.nrow == 0)
Opt.ncol = 1;
Opt.nrow = nobj;
elseif (Opt.ncol == 0)
Opt.ncol = ceil(nobj./Opt.nrow);
elseif (Opt.nrow == 0)
Opt.nrow = ceil(nobj./Opt.ncol);
end
if Opt.ncol*Opt.nrow < nobj
error('Number of legend entries greater than specified grid allows; change ncol and/or nrow');
end
% Reference object
if hg2flag
if isempty(Opt.ref)
if all(ishandle(legin{1}))
tmp = ancestor(legin{1}, 'axes');
if iscell(tmp)
Opt.ref = tmp{1};
else
Opt.ref = tmp(1);
end
else
Opt.ref = gca;
end
end
else
if isnan(Opt.ref)
tmp = get(h.leg, 'UserData');
Opt.ref = tmp.PlotHandle;
end
end
if ~ishandle(Opt.ref)
error('Input ref must be a graphics handle');
end
% Box
Opt.box = strcmpi('on', Opt.box);
% Convert units to getpos abbreviations
unittable = {...
'px' 'Pixels'
'nz' 'Normalized'
'in' 'Inches'
'cm' 'Centimeters'
'pt' 'Points'
'ch' 'Characters'};
Opt.bufunit = unittable{strcmpi(unittable(:,2),Opt.bufferunit),1};
% Check for title
addtitle = ~isempty(Opt.title);
%-------------------
% New placement of
% everything in
% legend
%-------------------
% Determine parent figure
figh = ancestor(Opt.ref, 'figure');
currax = get(figh, 'currentaxes');
% Calculate row height
legpospx = getpos(h.leg, 'px');
% rowHeight = legpospx(4)/nobj;
vmarginNm = 0.275/nobj;
vmarginPx = legpospx(4) * vmarginNm;
rowHeightNm = (1 - vmarginNm)/nobj;
rowHeight = rowHeightNm .* legpospx(4);
% Determine width needed for each text string
if nobj == 1
textExtent = get(h.obj(1:nobj), 'Extent');
else
textExtent = cell2mat(get(h.obj(1:nobj), 'Extent'));
end
textWidthPx = textExtent(:,3) .* legpospx(3);
textHeightPx = textExtent(:,4) .* legpospx(4);
textWidthNm = textExtent(:,3);
% Calculate horizontal space needed for symbols
symbolWidthPx = textExtent(1,1) .* legpospx(3) * Opt.xscale;
symbolWidthNm = textExtent(1,1);
% Calculate column width needed for 2px-symbol-1px-text-1px
colWidth = zeros(Opt.ncol*Opt.nrow,1);
colWidth(1:nobj) = textWidthPx + symbolWidthPx + sum(Opt.padding);
colWidth = reshape(colWidth, Opt.nrow, Opt.ncol);
colWidth = max(colWidth,[],1);
% If title is added, figure out how much space it will need
if addtitle
textProps = {'FontAngle','FontName','FontSize','FontUnits','FontWeight','Interpreter'};
textVals = get(h.obj(1), textProps);
ttlprops = [textProps; textVals];
fpos = getpos(figh, 'px');
figtmp = figure('units','pixels','position',[0 0 fpos(3:4)],'visible','off');
axes('parent',figtmp,'position',[0 0 1 1],'xlim',[0 fpos(3)],'ylim',[0 fpos(4)]);
tmp = text(0,0,Opt.title, ttlprops{:}, 'horiz', 'left', 'vert', 'bottom');
ttlex = get(tmp, 'extent');
ttlwidth = ceil(ttlex(3)) + 4; % Add a little padding
ttlheight = ceil(ttlex(4));
if ttlwidth > sum(colWidth)
colWidth(end) = colWidth(end) + (ttlwidth-sum(colWidth));
end
close(figtmp);
end
% Locate bottom left corner of each legend symbol, text box, and title
xsymbnew = [0 cumsum(colWidth(1:end-1))]+Opt.padding(1);
ysymbnew = (rowHeight*Opt.nrow + vmarginPx)-(1:Opt.nrow)*rowHeight;
[xsymbnew, ysymbnew] = meshgrid(xsymbnew, ysymbnew);
xsymbnew = xsymbnew(1:nobj);
ysymbnew = ysymbnew(1:nobj);
xtext = xsymbnew + Opt.padding(2) + symbolWidthPx;
ytext = ysymbnew;% + 1;
xsymbold = zeros(nobj,1);
ysymbold = 1 - (1/nobj)*(1:nobj);
wnewleg = sum(colWidth);
hnewleg = rowHeight*Opt.nrow + vmarginPx;
if addtitle
xttl = wnewleg/2;
yttl = hnewleg;
hnewleg = hnewleg + ttlheight;
end
% Get legend position in bufferunit and translate to pixels
legpos = positionleg(Opt.ref, wnewleg, hnewleg, Opt.anchor, Opt.buffer, Opt.bufunit);
tmpax = axes('units', Opt.bufferunit, 'position', legpos,'visible','off');
legpos = getpos(tmpax, 'px');
delete(tmpax);
%-------------------
% Create legend
%-------------------
% Create the legend axis
hnew.leg = axes('units', 'pixels', ...
'position', legpos, ...
'xlim', [0 legpos(3)], ...
'ylim', [0 legpos(4)], ...
'xtick', [], ...
'ytick', [], ...
'box', 'on', ...
'parent', figh);
% Copy the text strings to the new legend
textProps = {'FontAngle','FontName','FontSize','FontUnits','FontWeight','Interpreter','HorizontalAlignment','VerticalAlignment'};
textVals = get(h.obj(1:nobj), textProps);
if hg2flag
hnew.obj = gobjects(size(h.obj));
else
hnew.obj = zeros(size(h.obj));
end
for it = 1:nobj
props = [textProps; textVals(it,:)];
hnew.obj(it) = text(xtext(it), ytext(it), h.textstr{it}, props{:}, ...
'horizontalalignment', 'left', ...
'verticalalignment', 'bottom');
end
% Copy the symbols to the new legend
nsymbol = length(h.obj) - nobj;
for ii = 1:nsymbol
if strcmp(get(h.obj(nobj+ii), 'type'), 'hggroup')
tag = get(h.obj(nobj+ii),'Tag');
if ~isempty(tag)
[blah, idx] = ismember(tag,h.textstr);
end
chld = findall(h.obj(nobj+ii), 'type', 'line', '-or', 'type', 'patch');
for ic = 1:length(chld)
xy = get(chld(ic), {'xdata', 'ydata'});
xnorm = xy{1}./symbolWidthNm;
ynorm = (xy{2}- (1-idx*rowHeightNm))./rowHeightNm;
xnew = xnorm * symbolWidthPx + xsymbnew(idx);
ynew = ynorm * rowHeight + ysymbnew(idx);
set(chld(ic), 'xdata', xnew, 'ydata', ynew);
end
hnew.obj(nobj+ii) = copyobj(h.obj(nobj+ii), hnew.leg);
else
hnew.obj(nobj+ii) = copyobj(h.obj(nobj+ii), hnew.leg);
tag = get(h.obj(nobj+ii),'Tag');
if ~isempty(tag) % assumes empty tags indicate repetition of previous tag (true pre-2014b)
[blah, idx] = ismember(tag,h.textstr);
end
xy = get(h.obj(nobj+ii), {'xdata', 'ydata'});
xnorm = xy{1}./symbolWidthNm;
ynorm = (xy{2}- (1-idx*rowHeightNm))./rowHeightNm;
xnew = xnorm * symbolWidthPx + xsymbnew(idx);
ynew = ynorm * rowHeight + ysymbnew(idx);
set(hnew.obj(nobj+ii), 'xdata', xnew, 'ydata', ynew);
end
end
% Add title
if addtitle
text(xttl, yttl, Opt.title, ttlprops{:}, 'horiz', 'center', 'vert', 'bottom');
end
% Add box or hide axis
if Opt.box
set(hnew.leg, 'box', 'on');
else
if hg2flag
set(hnew.leg, 'box', 'off', 'color', 'none', 'xcolor', 'none', 'ycolor', 'none');
else
set(hnew.leg, 'visible', 'off');
end
end
% Delete the temporary legend
delete(h.leg);
% Return focus to previously-current axis
set(figh, 'currentaxes', currax);
drawnow; % Not sure why this is necessary for the currentaxes to take effect, but it is
% Fix for vertical-alignment issue: This solution still isn't perfect, but
% it seems to help for most Interpreter-none and Interpreter-latex cases.
% The TeX interpreter still places sub- and superscripts too high/low... no
% robust fix found for that yet.
%
% TODO: need to add proper calcs for when title included
%
% Thanks to S<EFBFBD>ren Enemark for this suggestion.
if ~addtitle
try % TODO: Crashing on some edge cases
textobj = hnew.obj(1:nobj);
yheight = get(hnew.leg, 'ylim');
yheight = yheight(2);
ylo = get(textobj(Opt.nrow), 'extent');
ylo = ylo(2);
yhi = get(textobj(1), 'extent');
yhi = sum(yhi([2 4]));
dy = yheight/2 - 0.5*(ylo + yhi);
for ii = 1:length(textobj)
pos = get(textobj(ii), 'position');
set(textobj(ii), 'position', pos + [0 dy 0]);
end
end
end
%-------------------
% Callbacks and
% listeners
%-------------------
% Save some relevant variables in the new legend axis's application data
Lf.ref = Opt.ref;
Lf.w = wnewleg;
Lf.h = hnewleg;
Lf.anchor = Opt.anchor;
Lf.buffer = Opt.buffer;
Lf.bufunit = Opt.bufunit;
Lf.bufferunit = Opt.bufferunit;
Lf.plotobj = h.labeledobj;
Lf.legobj = hnew.obj;
setappdata(hnew.leg, 'legflex', Lf);
% Resize listeners
addlistener(hnew.leg, 'Position', 'PostSet', @(src,evt) updatelegappdata(src,evt,hnew.leg));
if hg2flag && strcmp(Lf.ref.Type, 'figure')
addlistener(Lf.ref, 'SizeChanged', @(src,evt) updatelegpos(src,evt,hnew.leg));
else
addlistener(Lf.ref, 'Position', 'PostSet', @(src,evt) updatelegpos(src,evt,hnew.leg));
end
rsz = get(figh, 'ResizeFcn');
if isempty(rsz) % No previous resize function
set(figh, 'ResizeFcn', @updatelegfigresize);
else
if ~iscell(rsz)
rsz = {rsz};
end
hasprev = cellfun(@(x) isequal(x, @updatelegfigresize), rsz);
if ~hasprev
rsz = {rsz{:} @updatelegfigresize};
set(figh, 'ResizeFcn', {@wrapper, rsz});
end
end
if ~Opt.nolisten
% Run the resync function if anything changes with the labeled objects
objwatch = findall(h.labeledobj, 'type', 'line', '-or', 'type', 'patch');
for ii = 1:length(objwatch)
switch lower(get(objwatch(ii), 'type'))
case 'line'
triggerprops = {'Color','LineStyle','LineWidth','Marker','MarkerSize','MarkerEdgeColor','MarkerFaceColor'};
addlistener(objwatch(ii), triggerprops, 'PostSet', @(h,ed) resyncprops(h,ed,hnew.leg));
case 'patch'
triggerprops = {'CData','CDataMapping','EdgeAlpha','EdgeColor','FaceAlpha','FaceColor','LineStyle','LineWidth','Marker','MarkerEdgeColor','MarkerFaceColor','MarkerSize'};
addlistener(objwatch(ii), triggerprops, 'PostSet', @(h,ed) resyncprops(h,ed,hnew.leg));
end
end
end
%-------------------
% Output
%-------------------
out = {hnew.leg, hnew.obj, h.labeledobj, h.textstr};
varargout = out(1:nargout);
%***** Subfunctions *****
%------------------------
% Position new legend
%------------------------
function legpos = positionleg(href, w, h, anchor, buffer, bufunit)
% ap: position vector for reference object
% lp: position vector for legend
if strcmp(get(href, 'type'), 'figure')
tmp = axes('parent', href,'position', [0 0 1 1],'visible','off');
pos = getpos(tmp, bufunit);
delete(tmp);
else
pos = getpos(href, bufunit);
end
htmp = axes('units', 'pixels', 'position', [0 0 w h], 'visible','off');
lpos = getpos(htmp, bufunit);
delete(htmp);
w = lpos(3);
h = lpos(4);
% Find anchor locations on reference object
refxy = [...
pos(1) pos(2)+pos(4)
pos(1)+pos(3)/2 pos(2)+pos(4)
pos(1)+pos(3) pos(2)+pos(4)
pos(1)+pos(3) pos(2)+pos(4)/2
pos(1)+pos(3) pos(2)
pos(1)+pos(3)/2 pos(2)
pos(1) pos(2)
pos(1) pos(2)+pos(4)/2];
% How bottom left relates to each anchor point
shift = [...
0 -h
-w/2 -h
-w -h
-w -h/2
-w 0
-w/2 0
0 0
0 -h/2];
% Legend location
corner = refxy(anchor(1),:) + buffer + shift(anchor(2),:);
legpos = [corner w h];
%------------------------
% Listener functions
%------------------------
% If user manually resizes the legend, update the app data
function updatelegappdata(src, evt, legax)
if ishandle(legax)
Lf = getappdata(legax, 'legflex');
pos = getpos(legax, 'px');
Lf.w = pos(3);
Lf.h = pos(4);
setappdata(legax, 'legflex', Lf);
end
% If reference object moves or resizes, reposition the legend appropriately
function updatelegpos(src, evt, legax)
if ishandle(legax)
Lf = getappdata(legax, 'legflex');
legpos = positionleg(Lf.ref, Lf.w, Lf.h, Lf.anchor, Lf.buffer, Lf.bufunit);
set(legax, 'Units', Lf.bufferunit, 'Position', legpos);
end
% Since figure resize can change axis size without actually triggering a
% listener, force this
function updatelegfigresize(src, evt)
allax = findall(src, 'type', 'axes');
for ii = 1:length(allax)
isleg = ~isempty(getappdata(allax(ii), 'legflex'));
if ~isleg
pos = get(allax(ii), 'Position');
set(allax(ii), 'Position', pos); % No change, just trigger PostSet
end
end
% If plotted object changes, resync with legend
function resyncprops(src, evt, legax)
if ishandle(legax) % In case it's been deleted
Lf = getappdata(legax, 'legflex');
str = cellstr(num2str((1:length(Lf.plotobj))'));
[htmp.leg, htmp.obj, htmp.labeledobj, htmp.textstr] = legend(Lf.plotobj, str);
objtype = get(Lf.legobj, 'type');
isline = strcmp(objtype, 'line');
ispatch = strcmp(objtype, 'patch');
ishg = strcmp(objtype, 'hggroup');
hgidx = find(ishg);
lobj = [Lf.legobj(isline) htmp.obj(isline)];
pobj = [Lf.legobj(ispatch) htmp.obj(ispatch)];
if ~isempty(hgidx)
for ih = hgidx
chldln1 = findall(Lf.legobj(ih), 'type', 'line');
chldln2 = findall(htmp.obj(ih), 'type', 'line');
lobj = [lobj; [chldln1 chldln2]];
chldpa1 = findall(Lf.legobj(ih), 'type', 'patch');
chldpa2 = findall(htmp.obj(ih), 'type', 'patch');
pobj = [pobj; [chldpa1 chldpa2]];
end
end
lprops = {'color','linestyle','linewidth','marker','markersize','markeredgecolor','markerfacecolor'};
for il = 1:size(lobj,1)
lvals = get(lobj(il,2), lprops);
pv = [lprops; lvals];
set(lobj(il,1), pv{:});
end
pprops = {'cdata','cdatamapping','edgealpha','edgecolor','facealpha','facecolor','linestyle','linewidth','marker','markeredgecolor','markerfacecolor','markersize'};
for ip = 1:size(pobj,1)
pvals = get(pobj(ip,2), pprops);
pv = [pprops; pvals];
set(pobj(ip,1), pv{:});
end
cmap = colormap(htmp.leg);
colormap(legax, cmap);
delete(htmp.leg);
end
% Wrapper to add multiple callback functions to resize
function wrapper(ObjH, EventData, fcnList)
for ii = 1:length(fcnList)
feval(fcnList{ii}, ObjH, EventData);
end

BIN
01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_01.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_02.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_03.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_04.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
01_tex/figures/00_matlab_fcn/legendflex/readmeExtras/README_05.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

37
01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/.gitignore vendored

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

182
01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/getpos.m

@ -0,0 +1,182 @@ @@ -0,0 +1,182 @@
function [pos,unit]=getpos(h,fmt,href,opt)
% GETPOS Get graphics object position in a flexible way.
% GETPOS(H,FMT) gets the position property of graphics object
% with handle H, according to FMT that can be expressed using different
% units. H must have a "Position" property.
%
% FMT is a char array containing four "%2c" strings separated by colon or
% space. The two characters specify the unit as :
%
% px for Pixels
% nz for Normalized
% in for Inches
% cm for Centimeters
% pt for Points
% ch for Characters
%
% If FMT is only one format string from the above list, all returned values are
% expressed using this unit.
%
% Any string value of FMT can be replaced by a single '#' to not retrieve the
% corresponding value. The returned value is NaN except if the optional last
% argument OPT is set to "compact" in GETPOS(H,FMT,[HREF],OPT).
%
% Note that GETPOS(H) works as get(H,'Position') and return the position
% vector in the current unit of the graphics object H.
%
% GETPOS(H,FMT,HREF,['compact']) gets the position of the graphics object H according
% to FMT, but using the position of the graphics object HREF as reference instead
% of the parent of H. HREF must be a valid handle and must have a "Position"
% property (except for the Root object). Returned values may be negative or 0.
%
% [POS,UNIT]=GETPOS(H,...) returns an additional output argument UNIT that
% contained the unit list of the output vector position POS. It may be safer
% when different units are used.
%
% See also SETPOS, SET, GET.
% Author: Jérôme Briot, Matlab 6.1.0.450 (R12.1)
% Contact: dutmatlab@yahoo.fr
% Revision: 1.0 (12-Feb-2007)
% 1.1 (14-Feb-2007) Third input argument HREF added.
% Minor corrections in the help section.
% 1.2 (21-Feb-2007) Bug fixed if HREF is the Root object
% Examples removed from the help section
% Comments:
%
% Check the number of input arguments
narginchk(1,4);
% Check if H is a graphics object handle
if ~ishandle(h)
error('First argument must be a graphic object handle');
end
% Store the current unit of the graphics object H
current_unit=get(h,'units');
% Init variables
unit={current_unit current_unit current_unit current_unit};
pos=[nan nan nan nan];
% If FMT input argument is not specified, works as GET(H,'Position')
if nargin==1
pos=get(h,'position');
return
end
% Check if FMT is a char string
if ~ischar(fmt)
error('Second argument must be a string in GETPOS(H,FMT)')
end
if nargin==2 % GETPOS(H,FMT)
href=get(h,'parent');
opt='full';
elseif nargin==3
if ishandle(href) % GETPOS(H,FMT,HREF)
opt='full';
elseif strcmpi(href,'compact') % GETPOS(H,FMT,"compact")
href=get(h,'parent');
opt='compact';
else % GETPOS(H,FMT,???)
error('Wrong third argument in GETPOS(H,FMT,???). Must be a valid handle or "compact"');
end
elseif nargin==4 % GETPOS(H,FMT,HREF,OPT)
if ~ishandle(href)
error('Third argument must be a valid handle in GETPOS(H,FMT,HREF,OPT)');
end
if ~strcmpi(opt,'compact')
error('Last argument must be "compact" in GETPOS(H,FMT,HREF,OPT)');
end
end
flag_href=0;
% Don't use HREF position if it is the parent of H
if href~=get(h,'parent')
href=h;
flag_href=1;
end
% Store the current unit of the reference object HREF
current_ref_unit=get(href,'units');
% Extract 4 char strings from FMT
M=strread(fmt,'%s','delimiter',' ,');
% Only one FMT requested for output
if numel(M)==1
[M{2:4}]=deal(M{1});
end
% List available units
available_units={'inches' 'centimeters' 'normalized' 'points' 'pixels' 'characters'};
% Decode elements of FMT
for n=1:numel(M)
% If FMT(n) is not a "#"
if ~strcmp(M{n},'#')
% Check if the units paramter is valid
idx=strcmpi(M{n},{'in' 'cm' 'nz' 'pt' 'px' 'ch'});
if ~any(idx)
error('Units must be one of "in", "cm", "nz", "pt", "px" or "ch"')
end
unit{n}=available_units{idx}; % Set the units to one from the list
end
end
% Get position of H using decoded FMT
for n=1:numel(M)
% If FMT(n) is not a "#" => get the value
if ~strcmp(M{n},'#')
% Modify the "Units" property of H
set(h,'units',unit{n});
% Modify the "Units" property of HREF
set(href,'units',unit{n});
% Get the current "Position" vector of H
temp=get(h,'position');
% Get the current "Position" vector of HREF
if strcmp(get(href, 'type'), 'root') % HREF is the Root object (no 'Position' property)
temp_href=get(href,'screensize'); %%% Should be safe here !
else temp_href=get(href,'position');
end
% Get and store the specified field from the "Position" vector
% If HREF is specified and is not the parent of H, flag_href=1 else flag_href=0
pos(n)=temp(n)-temp_href(n)*flag_href;
end
end
% Check for compact output format
if strcmpi(opt,'compact')
pos(isnan(pos))=[];
end
% Restore the unit of the graphics object H
set(h,'units',current_unit);
% Restore the unit of the reference object HREF
set(href,'units',current_ref_unit);

104
01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/setgetposexamples.m

@ -0,0 +1,104 @@ @@ -0,0 +1,104 @@
function setgetposexamples(n)
% SETGETPOSEXAMPLES Launch SETPOS/GETPOS examples.
% SETGETPOSEXAMPLES(N) launches the Nth example for setpos/getpos
% commands. Edit SETGETPOSDEMO.M for more informations about
% each example.
%
% This demo file will be improved in the future (...I hope)
% Author: Jérôme Briot, Matlab 6.1.0.450 (R12.1)
% Contact: dutmatlab@yahoo.fr
% Revision: 1.0 (21-Feb-2007)
% Comments:
%
% Check the number of input arguments
narginchk(0,1);
if nargin==0
n=1;
end
switch n
case 1% Create a figure with "Position" property sets to
% [0.25{normalized} 100{pixels} 0.5{normalized} 300{pixels}] :
h=figure;
setpos(h,'0.25nz 100px 0.5nz 300px');
disp('To create a figure with "Position" property sets to')
disp('[0.25{normalized} 100{pixels} 0.5{normalized} 300{pixels}]')
case 2% Only set the width of a figure to 0.5{normalized} :
h=figure('units','pixels','position',[0 200 200 400]);
pause(.5)
setpos(h,'# # .5nz #');
case 3% Add 200{pixels} to the width of a figure :
h=figure('units','normalized','position',[.1 .1 .5 .8]);
pause(.5)
setpos(h,'# # +200px #');
case 4% Use SETPOS as SET(H,'Position',...)
h=figure('units','pixels');
setpos(h,[100 100 300 200]);
case 5% TSet the position of a pushbutton according to the current
% axes position (instead of the figure parent)
figure
axes
u(1)=uicontrol('string','(0,0) gcf');
setpos(u(1),'0 0 60px 40px')
u(2)=uicontrol('string','(0,0) gca');
setpos(u(2),'0 0 60px 40px',gca)
case 6% Create a uniformly-spaced group of buttons
figure
u(1)=uicontrol;
for n=2:5
u(n)=uicontrol;
setpos(u(n),'# 30px # #',u(n-1));
end
case 7% Get the Left&Bottom position in {Pixels} and the
% Width&Height position in {Points} of a figure object :
h=figure('units','normalized','position',[.1 .1 .5 .8]);
pos=getpos(h,'px px pt pt')
case 8% Get the default "Position" of the figure object in all units
h=figure;
pos=[getpos(h,'px')
getpos(h,'nz')
getpos(h,'in')
getpos(h,'cm')
getpos(h,'pt')
getpos(h,'ch')]
case 9% Only get the width in {Normalized} of a figure
h=figure('units','pixels','position',[100 100 200 400]);
pos=getpos(h,'# # nz #')
%or
pos=getpos(h,'# # nz #','compact')
case 10% Get the position of one button to another one
figure
u(1)=uicontrol('units','pixels','position',[50 50 100 30]);
u(2)=uicontrol('units','pixels','position',[200 150 100 30]);
pos=getpos(u(1),'px',u(2))
pos=getpos(u(1),'# px # px',u(2),'compact')
end

189
01_tex/figures/00_matlab_fcn/legendflex/setgetpos_V1.2/setpos.m

@ -0,0 +1,189 @@ @@ -0,0 +1,189 @@
function setpos(h,fmt,href)
% SETPOS Set graphics object position in a flexible way.
% SETPOS(H,FMT) sets the position property of graphics object
% with handle H, according to FMT that can be expressed using different
% units. H must have a "Position' property.
%
% FMT is a char array containing 4 strings separated by colon or space.
% The format of each string is one of "%1c%f%2c" or "%1c%d%2c" where the
% first optional argument is "+" or "-", the second one is a number and
% the last one is two characters that specify the unit as :
%
% px for Pixels
% nz for Normalized
% in for Inches
% cm for Centimeters
% pt for Points
% ch for Characters
% [] (empty) for Current units [See get(H,'units')]
%
% For better rendering, SETPOS can be included into the "Createfcn" or
% "Resizefcn" properties of the graphical object H.
%
% Any string value of FMT can be replaced by a single '#' to keep the current
% value of the corresponding parameter.
%
% The first optional argument of FMT is used to increase ('+') or
% decrease ('-') the corresponding value.
%
% Note that SETPOS(H,FMT) works as set(H,'Position',FMT) when FMT is
% a 4 double values vector.
%
% SETPOS(H,FMT,HREF) sets the position of the graphics object H according to
% FMT, but using the position of the graphics object HREF as reference instead
% of the parent of H. HREF must be a valid handle and must have a "Position"
% property (except for the Root object). Note that this should only affect
% Left&Bottom (1st&2nd) element of the "Position" vector of H.
%
% See also GETPOS, SET, GET.
% Author: Jérôme Briot, Matlab 6.1.0.450 (R12.1)
% Contact: dutmatlab@yahoo.fr
% Revision: 1.0 (12-Feb-2007)
% 1.1 (14-Feb-2007) Third input argument HREF added.
% Minor corrections in the help section.
% 1.2 (21-Feb-2007) Bug fixed if HREF is the Root object
% Examples removed from the help section
% Comments:
%
% Check the number of input arguments
narginchk(2,3);
% Check if H is a graphics object handle
if ~ishandle(h)
error('First argument must be a graphic object handle in SETPOS(H,FMT)');
end
% If FMT is a 4x1 double vector then SETPOS works as SET(H,'Position',FMT)
if isnumeric(fmt) & numel(fmt(:))==4
set(h,'position',fmt)
return
% If FMT is not a double vector, check if it's a char string
elseif ~ischar(fmt)
error('FMT argument must be a string or a 4 elements vector in SETPOS(H,FMT)');
end
if nargin==2 % SETPOS(H,FMT)
%HREF = parent of H
href=get(h,'parent');
elseif nargin==3 % SETPOS(H,FMT,HREF)
if ~ishandle(href) % Check if HREF is a valid handle
error('HREF must be a valid handle of a graphics object in SETPOS(H,FMT,HREF)')
end
end
flag_href=0;
% Don't use HREF position if it is the parent of H
if href~=get(h,'parent')
flag_href=1;
end
% Extract 4 char strings from FMT
M=strread(fmt,'%s','delimiter',' ,','emptyvalue',0);
% Store the current unit of the graphics object H
current_unit=get(h,'units');
% Store the current unit of the reference object HREF
current_ref_unit=get(href,'units');
% List available units
available_units={'inches' 'centimeters' 'normalized' 'points' 'pixels' 'characters'};
flag=zeros(1,4);
% Decode elements of FMT
for n=1:numel(M)
% If FMT(n) is not a "#"
if ~strcmp(M{n},'#')
% Check if FMT(n) is +%... or -%...
if strncmp(M{n},'+',1)
flag(n)=1;
M{n}(1)=[]; % Remove '+' char
elseif strncmp(M{n},'-',1)
flag(n)=-1;
M{n}(1)=[]; % Remove '-' char
end
% Separate value and unit from FMT(n)
[val(n),temp_unit]=strread(M{n},'%f%s');
% If the unit is not specified in FMT(n)
if isempty(temp_unit)
unit{n}=current_unit; % Set the units to the current one
% Else check if the units paramter is valid
else idx=strcmpi(temp_unit,{'in' 'cm' 'nz' 'pt' 'px' 'ch'});
if ~any(idx)
error('Units must be one of "in", "cm", "nz", "pt", "px" or "ch"')
end
unit{n}=available_units{idx}; % Set the units to one from the list
end
end
end
% Set position of H using decoded FMT
for n=1:numel(M)
% If FMT(n) is not a "#" => value to modify
if ~strcmp(M{n},'#')
% Modify the "Units" property of H
set(h,'units',unit{n});
% Modify the "Units" property of HREF
set(href,'units',unit{n});
% Get the current "Position" vector of H
position_in_unit=get(h,'position');
% Get the current "Position" vector of HREF
if (isnumeric(href) && ~href) || (isgraphics(href) && isequal(href, groot)) % HREF is the Root object (no 'Position' property)
position_ref_unit=get(href,'screensize'); %%% Should be safe here !
else position_ref_unit=get(href,'position');
end
if ~flag % No "+" or "-"
if any(n==[1 2])
% If HREF is specified and is not the parent of H, flag_href=1 else flag_href=0
position_in_unit(n)=val(n)+position_ref_unit(n)*flag_href;
else position_in_unit(n)=val(n);
end
elseif any(n==[3 4]) % "+" or "-" and FMT(n) is width or height
position_in_unit(n)=position_in_unit(n)+val(n)*flag(n);
else % "+" or "-" and FMT(n) is left or bottom
position_in_unit(n)=position_in_unit(n)+val(n)*flag(n);
position_in_unit(n+2)=position_in_unit(n+2)-val(n)*flag(n);
end
% Modify the "Position" property of H
set(h,'position',position_in_unit)
end
end
% Restore the unit of the graphics object H
set(h,'units',current_unit);
% Restore the unit of the reference object HREF
set(href,'units',current_ref_unit);

6
01_tex/figures/00_matlab_fcn/matlab2tikz/.gitignore vendored

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
*.sublime-workspace
*.tap
test/*.test.*
*.asv
*.m~
octave-workspace

16
01_tex/figures/00_matlab_fcn/matlab2tikz/.travis.yml

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
language: c++
before_install:
- sudo add-apt-repository -y ppa:octave/stable
- sudo apt-get update -qq
- sudo apt-get install gdb # to capture backtrace of eventual failures
- sudo apt-get install octave
- sudo apt-get purge libopenblas-base # fixes PPA Octave 4.0 crash on Travis
before_script:
- ulimit -c unlimited -S # enable core dumps for Octave crash debugging
script:
- ./runtests.sh /usr/bin/octave
notifications:
hipchat: f4c2c5f87adc85025545e5b59b3fbe@Matlab2tikz
after_failure:
- COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1) # find core file
- gdb -c "$COREFILE" -ex "thread apply all bt" -ex "set pagination 0" -batch /usr/bin/octave-cli # print stack trace

63
01_tex/figures/00_matlab_fcn/matlab2tikz/AUTHORS.md

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
# Maintainer
* [Egon Geerardyn](https://github.com/egeerardyn) is the current maintainer (2015 - now).
* [Nico Schlömer](https://github.com/nschloe) designed and implemented the intial version and was the first maintainer (2008 - 2015).
# Contributors
Thanks for patches, suggestions, and other contributions go to:
* [Ben Abbott](https://github.com/bpabbott)
* Martijn Aben (The MathWorks)
* [Nicolas Alt](https://github.com/nalt)
* [Eshwar Andhavarapu](https://github.com/gontadu)
* Matt Bauman
* Eike Blechschmidt
* [Klaus Broelemann](https://github.com/Broele)
* [Katherine Elkington](https://github.com/kelkington)
* [Thomas Emmert](https://github.com/murmlgrmpf)
* Andreas Gäb
* [Egon Geerardyn](https://github.com/egeerardyn)
* Roman Gesenhues
* Michael Glasser (The MathWorks)
* [David Haberthür](https://github.com/habi)
* [Patrick Häcker](https://github.com/MagicMuscleMan)
* [Ulrich Herter](https://github.com/ulijh)
* [David Horsley](https://github.com/widdma)
* Kári Hreinsson
* [Lucas Jeub](https://github.com/LJeub)
* Martin Kiefel
* [Andreas Kloeckner](https://github.com/akloeckner)
* Mykel Kochenderfer
* [Oleg Komarov](https://github.com/okomarov)
* Henk Kortier
* [Tom Lankhorst](https://github.com/tomlankhorst)
* [Burkart Lingner](https://github.com/burkart)
* Theo Markettos
* [Dragan Mitrevski](https://github.com/nidrosianDeath)
* [Jason Monschke](https://github.com/jam4375)
* Francesco Montorsi
* Ricardo Santiago Mozos
* Johannes Mueller-Roemer
* [Ali Ozdagli](https://github.com/aliirmak)
* [Richard Peschke](https://github.com/RPeschke)
* [Peter Ploß](https://github.com/PeterPablo)
* Julien Ridoux
* [Christoph Rüdiger](https://github.com/mredd)
* Carlos Russo
* [Manuel Schiller](https://github.com/dachziegel)
* [Nico Schlömer](https://github.com/nschloe)
* Johannes Schmitz
* Michael Schoeberl
* [Jan Taro Svejda](https://github.com/JTSvejda)
* [José Vallet](https://github.com/josombio)
* [Thomas Wagner](https://github.com/Aikhjarto)
* Donghua Wang
* [Patrick Wang](https://github.com/patrickkwang)
* Robert Whittlesey
* Pooya Ziraksaz
* Bastiaan Zuurendonk (The MathWorks)
* GitHub users: [andreas12345](https://github.com/andreas12345), [theswitch](https://github.com/theswitch)
# Acknowledgements
Matlab2tikz has once greatly profited from its ancestor: [Matfig2PGF](http://www.mathworks.com/matlabcentral/fileexchange/12962) written by Paul Wagenaars.
Also, the authors would like to thank [Christian Feuersänger](https://github.com/cfeuersaenger) for the [Pgfplots](http://pgfplots.sourceforge.net) package which forms the basis for the matlab2tikz output on the LaTeX side.

439
01_tex/figures/00_matlab_fcn/matlab2tikz/CHANGELOG.md

@ -0,0 +1,439 @@ @@ -0,0 +1,439 @@
# 2016-08-15 Version 1.1.0 [Egon Geerardyn](egon.geerardyn@gmail.com)
* Added or improved support for:
- Octave 4.0 (#759)
- `scatter`, `quiver` and `errorbar` support in Octave (#669)
- `cleanfigure` has been improved:
* New and superior (Opheim) simplification algorithm
* Simplification for `plot3` (3D plots) (#790)
* Vectorized implementations (#756, #737)
* Overall clean-up of the code (#797, #787, #776, #744)
* Optional limitation of data precision (#791)
* Textbox removal is being phased out (#817)
- Quiver plots now translate to native pgfplots quivers (#679, #690)
- Legends, especially with `plotyy`, now use `\label` (#140, #760, #773)
- Tick labels with `datetime` (#383, #803)
- `contourf`/`contour` plots with matrix arguments and nonstandard line widths (#592, #721, #722, #871)
- Colored ticks and axes (#880, #908)
- Scatter plots with different marker colors and sizes (#859, #861)
- `colorbar` positioning and tick placement (#933, #937, #941)
- The self-updater has been improved
* New parameters:
- `arrowHeadSizeFactor` for tweaking the size of arrowheads
- `semanticLineWidths` for tweaking semantic line width conversion (e.g. `thick` instead of `0.8pt`)
* Extra requirements:
- Quiver plots require `\usetikzlibrary{arrows.meta}`
* Bug fixes:
- Errorbars without lines & markers (#813)
- `light`/`camera` objects are now ignored (#684)
- Draw baseline in bar/stem plots (#798)
- Multiple annotation containers (#728, #730)
- Legends of bode plots (#700, #702)
- Titles of bode plots (#715, #716, #753)
- Patch without fill/edge color (#682, #701, #740)
- Warn about usage of faceted interp shader (#699)
- Tick labels are properly escaped now (#711)
- Swapped image dimensions (#714)
- Width of bar plots was incorrect (#727, #696)
- Stacking and placement of bar plots (#851, #845, #840, #785, #903)
- Handling of tick labels when `parseStrings=false` (#86, #871)
- Properly escape tick labels for LaTeX (#710, #711, #820, #821)
- Respect edge color in `scatter` plots (#900)
- Output directory is created automatically (#889, #929)
- TikZ output format has been improved slightly (#936, #921, #801)
* For developers:
- Please check out the (guidelines)[CONTRIBUTING.md]
- We now use `allchild` and `findall` (#718)
- SublimeText project files
- Test hashes can be saved selectively (#720)
- Continuous testing for MATLAB and Octave 3.8 with Jenkins
- Test suite timing is tracked (#738)
- The testing reports have been improved for GitHub (#708)
- Testing can output to different directories (#818)
- A new tool to help track regressions (#814)
- A new tool to consistently format the code (#808, #809)
- `figure2dot` updated for HG2
# 2015-06-15 Version 1.0.0 [Egon Geerardyn](egon.geerardyn@gmail.com)
* Added support for:
- Annotations (except arrows) in R2014b (#534)
- `Histogram` in R2014b (#525)
- Filled contour plots in R2014b (#379, #500)
- Contour plots with color maps in R2014b (#380, #500)
- Axes background color and overlap (#6, #509, #510)
- Horizontal/Vertical text alignment (#491)
* Extra requirements:
- Patch plots now require `\usepgfplotslibrary{patchplots}` (#386, #497)
* Bug fixes:
- Pgfplots 1.12 (`row sep=crcr`) in combination with `externalData==true` (#548)
- Updater has been fixed (#502)
- 3D plot sizing takes viewing angle into account (#560, #630, #631)
- Alpha channel (transparency) in images (#561)
- Colorbar labels in R2014b (#429, #488)
- Scaling of color data at axes level (#486)
- Text formatting (for `TeX` parser) is improved (#417)
- Support for `|` character in labels (#587, #589)
- Legends for `stairs` and `area` plots (#601, #602)
- `cleanfigure()` removes points outside of the axes for `stairs` plots (#226, #533)
- `cleanfigure()` removes points outside of the axes better (#392, #400, #547)
- Support `>` and `<` in text (#522)
- Better text positioning (#518)
- Text boxes on 3D graphs (#528)
- File closing is more robust (#496, #555)
- TikZ picture output, i.e.`imageAsPng==false`, improved (#581, #596)
- `standalone==true` sets the font and input encoding in LaTeX (#590)
- Legend text alignment in Octave (#668)
- Improved Octave legend if not all lines have an entry (#607, #619, #653)
- Legend without a drawn box in R2014b+ (#652)
- Misc. fixes: #426, #513, #520, #665
* For developers:
- The testing framework has been revamped (see also `test/README.md`)
- A lot of the tests have been updated (#604, #614, #638, ...)
- Cyclomatic complexity of the code has been reduced (#391)
- Repository has been moved to [matlab2tikz/matlab2tikz](https://github.com/matlab2tikz/matlab2tikz)
- Extra files have been pruned (#616)
# 2014-11-02 Version 0.6.0 [Nico Schlömer](nico.schloemer@gmail.com)
* Annotation support in R2014a and earlier
* New subplot positioning approach (by Klaus Broelemann) that uses absolute instead of relative positions.
* Support stacked bar plots and others in the same axes (needs pgfplots 1.11).
* Support legends with multiline entries.
* Support for the alpha channel in PNG output.
* Test framework updated and doesn't display figures by default.
* Major code clean-up and code complexity checks.
* Bug fixes:
- Cycle paths only when needed (#317, #49, #404)
- Don't use infinite xmin/max, etc. (#436)
- Warn about the `noSize` parameter (#431)
- Images aren't flipped anymore (#401)
- No scientific notation in width/height (#396)
- Axes with custom colors (#376)
- Mesh plots are exported properly (#382)
- Legend colors are handled better (#389)
- Handle Z axis properties for quiver3 (#406)
- Better text handling, e.g. degrees (#402)
- Don't output absolute paths into TikZ by default
- ...
# 2014-10-20 Version 0.5.0 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for MATLAB 2014b (with it's substantial graphics changes).
All credit goes to Egon Geerardyn.
* Bugfixes:
- single bar width
- invisible bar plots
- surface options
- patch plots and cycling
- patches with literal colors
# 2014-03-07 Version 0.4.7 [Nico Schlömer](nico.schloemer@gmail.com)
* Acid tests: Remove MATLAB-based `eps2pdf`.
* Bugfixes:
- multiple patches
- log plot with nonzero baseline
- marker options for scatter plots
- table data formatting
- several fixes for Octave
# 2014-02-07 Version 0.4.6 [Nico Schlömer](nico.schloemer@gmail.com)
* Set `externalData` default to `false`.
* Properly check for required Pgfplots version.
* Marker scaling in scatter plots.
# 2014-02-02 Version 0.4.5 [Nico Schlömer](nico.schloemer@gmail.com)
* Arrange data in tables.
* Optionally define custom colors.
* Allow for strict setting of font sizes.
* Bugfixes:
- tick labels for log plots
- tick labels with commas
# 2014-01-02 Version 0.4.4 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for color maps with scatter plots.
* Support for different-length up-down error bars.
* Input options validation.
* Bugfixes:
- legends for both area and line plots
- invisible text fields
# 2013-10-20 Version 0.4.3 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for 3D quiver plots.
* Extended support for colorbar axis options.
* New logo!
* Bugfixes:
- text generation
- extraCode option
- join strings
- ...
# 2013-09-12 Version 0.4.2 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for explicit color specification in 3D plots.
* Better color handling for patch plots.
* Support for various unicode characters.
* Bugfixes:
- edge colors for bar plots
- multiple color bars
- ...
# 2013-08-14 Version 0.4.1 [Nico Schlömer](nico.schloemer@gmail.com)
* Replaced option `extraTikzpictureCode` by `extraCode`
for inserting code at the beginning of the file.
* Support for relative text positioning.
* Improved documentation.
* Code cleanup: moved all figure manipulations over to cleanfigure()
* Bugfixes:
- error bars
- empty tick labels
- ...
# 2013-06-26 Version 0.4.0 [Nico Schlömer](nico.schloemer@gmail.com)
* Added `cleanfigure()` for removing unwanted entities from a plot
before conversion
* Add option `floatFormat` to allow for custom specification of the format
of float numbers
* Bugfixes:
- linewidth for patches
- ...
# 2013-04-13 Version 0.3.3 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for:
- pictures in LaTeX subfloats
* Bugfixes:
- axes labels
- extra* options
- logscaled axes
- ...
# 2013-03-14 Version 0.3.2 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for:
- waterfall plots
* Bugfixes:
- axis locations
- color handling
- stacked bars
- ...
# 2013-02-15 Version 0.3.1 [Nico Schlömer](nico.schloemer@gmail.com)
* Use `table{}` for plots for cleaner output files.
* Support for:
- hg transformations
- pcolor plots
* Removed command line options:
- `minimumPointsDistance`
* Bugfixes:
- legend positioning and alignment
- tick labels
- a bunch of fixed for Octave
- line width for markers
- axis labels for color bars
- image trimming
- subplots with bars
- ...
# 2012-11-19 Version 0.3.0 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for:
- area plots
- legend position
- inner color bars
- log-scaled color bars
* New command line options:
- `standalone` (create compilable TeX file)
- `checkForUpdates`
* `mlint` cleanups.
* Removed deprecated options.
* Bugfixes:
- colorbar-axis association
- option parsing
- automatic updater
- unit 'px'
- ...
# 2012-09-01 Version 0.2.3 [Nico Schlömer](nico.schloemer@gmail.com)
* Multiline text for all entities.
* Support for logical images.
* Support for multiple legends (legends in subplots).
* Fixed version check bug.
* Fix `minimumPointsDistance`.
# 2012-07-19 Version 0.2.2 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for multiline titles and axis labels.
* Respect log-scaled axes for `minimumPointsDistance`.
* Add support for automatic graph labels via new option.
* About 5 bugfixes.
# 2012-05-04 Version 0.2.1 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for color maps.
* Support for native color bars.
* Partial support for hist3 plots.
* Support for spectrogram plots.
* Support for rotated text.
* Native handling of `Inf`s and `NaN`s.
* Better info text.
* matlab2tikz version checking.
* Line plotting code cleanup.
* About 10 bugfixes.
# 2012-03-17 Version 0.2.0 [Nico Schlömer](nico.schloemer@gmail.com)
* Greatly overhauled text handling. (Burkhart Lingner)
* Added option `tikzFileComment`.
* Added option `parseStrings`.
* Added option `extraTikzpictureSettings`.
* Added proper documetion (for `help matlab2tikz`).
* Improved legend positioning, orientation.
* Support for horizontal bar plots.
* Get bar widths right.
* Doubles are plottet with 15-digit precision now.
* Support for rectangle objects.
* Better color handling.
* Testing framework improvements.
* Several bugfixes:
- ticks handled more concisely
- line splitting bugs
- ...
# 2011-11-22 Version 0.1.4 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for scatter 3D plots.
* Support for 3D parameter curves.
* Support for 3D patches.
* Support for minor ticks.
* Add option `interpretTickLabelsAsTex` (default `false`).
* Several bugfixes:
- `%` sign in annotations
- fixed `\omega` and friends in annotations
- proper legend for bar plots
- don't override PNG files if there is more than one image plot
- don't always close patch paths
# 2011-08-22 Version 0.1.3 [Nico Schlömer](nico.schloemer@gmail.com)
* Greatly overhauled text handling.
* Better Octave compatibility.
* Several bugfixes:
- subplot order
- environment detection
# 2011-06-02 Version 0.1.2 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for logscaled color bar.
* Support for truecolor images.
* Initial support for text handles.
* Speed up processing for line plots.
* Several bugfixes:
- axis labels, tick labels, etc. for z-axis
- marker handling for scatter plots
- fix for unicolor scatter plots
# 2011-04-06 Version 0.1.1 [Nico Schlömer](nico.schloemer@gmail.com)
* Improved Octave compatibility.
* Several bugfixes:
- input parser
# 2011-01-31 Version 0.1.0 [Nico Schlömer](nico.schloemer@gmail.com)
* Basic Octave compatibility.
* Several bugfixes:
- bar plots fix (thanks to Christoph Rüdiger)
- fix legends with split graphs
# 2010-09-10 Version 0.0.7 [Nico Schlömer](nico.schloemer@gmail.com)
* Compatibility fixes for older MATLAB installations.
* Several bugfixes:
- line plots with only one point
- certain surface plots
- orientation of triangle markers (`<` vs. `>`)
- display of the color `purple`
# 2010-05-06 Version 0.0.6 [Nico Schlömer](nico.schloemer@gmail.com)
* Support for scatter plots.
* Preliminary support for surface plots; thanks to Pooya.
* Large changes in the codebase:
- next to `matlab2tikz.m`, the file `pgfplotsEnvironment.m` is now needed as well; it provides a much better structured approach to storing and writing environments when parsing the MATLAB(R) figure
* proper MATLAB(R) version check
* lots of small fixes
# 2009-12-21 Version 0.0.5 [Nico Schlömer](nico.schloemer@ua.ac.be)
* Improvements in axis handling:
- colored axes
- allow different left and right ordinates
* Improvements for line plots:
- far outliers are moved toward the plot,
avoiding `Dimension too large`-type errors in LaTeX
- optional point reduction by new option `minimumPointsDistance`
* Improvements for image handling:
- creation of a PNG file, added by `\addplot graphics`
- fixed axis orientation bug
* Bugfixes for:
- multiple axes
- CMYK colors
- legend text alignment (thanks Dragan Mitrevski)
- transparent patches (thanks Carlos Russo)
* Added support for:
- background color
- Bode plots
- zplane plots
- freqz plots
# 2009-06-09 Version 0.0.4 [Nico Schlömer](nico.schloemer@ua.ac.be)
* Added support for:
- error bars (thanks Robert Whittlesey for the suggestion)
* Improvents in:
- legends (thanks Theo Markettos for the patch),
- images,
- quiver plots (thanks Robert for spotting this).
* Improved options handling.
* Allow for custom file encoding (thanks Donghua Wang for the suggestion).
* Numerous bugfixes (thanks Andreas Gäb).
# 2009-03-08 Version 0.0.3 [Nico Schlömer](nico.schloemer@ua.ac.be)
* Added support for:
- subplots
- reverse axes
* Completed support for:
- images
# 2009-01-08 Version 0.0.2 [Nico Schlömer](nico.schloemer@ua.ac.be)
* Added support for:
- quiver (arrow) plots
- bar plots
- stem plots
- stairs plots
* Added preliminary support for:
- images
- rose plots
- compass plots
- polar plots
* Moreover, large code improvement have been introduced, notably:
- aspect ratio handling
- color handling
- plot options handling
# 2008-11-07 Version 0.0.1 [Nico Schlömer](nico.schloemer@ua.ac.be)
* Initial version

66
01_tex/figures/00_matlab_fcn/matlab2tikz/CONTRIBUTING.md

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
# Contributing to matlab2tikz
You can contribute in many ways to `matlab2tikz`:
- report bugs,
- suggest new features,
- write documentation,
- fix some of our bugs and implement new features.
The first part of this document is geared more towards users of `matlab2tikz`.
The latter part is only relevant if you want to write some code for `matlab2tikz`.
## How to report a bug or ask for help
1. Make sure you are using the [latest release](https://github.com/matlab2tikz/matlab2tikz/releases/latest) or even the [development version](https://github.com/matlab2tikz/matlab2tikz/tree/develop) of `matlab2tikz` and check that the problem still exists.
2. Also make sure you are using a recent version of the required LaTeX packages (especially [`pgfplots`](http://ctan.org/pkg/pgfplots) and the [`TikZ`](http://ctan.org/pkg/pgf) libraries)
3. You can submit your bug report or question to our [issue tracker](https://github.com/matlab2tikz/matlab2tikz/issues).
Please, have a look at "[How to Ask Questions the Smart Way](http://www.catb.org/esr/faqs/smart-questions.html)" and "[Writing Better Bug Reports](http://martiancraft.com/blog/2014/07/good-bug-reports/)" for generic guidelines. In short:
- Mention the version of MATLAB/Octave, the operating system, `matlab2tikz`, `pgfplots` and which `LaTeX` compiler you are using.
- Choose a descriptive title for your issue report.
- A short MATLAB code snippet that generates a plot where the problem occurs. Please limit this to what is strictly necessary to show the issue!
- Explain what is wrong with the conversion of the figure (or what error messages you see).
- Often it can be useful to also include a figure, `TikZ` code, ... to illustrate your point.
## How to request new features
Please check first whether the feature hasn't been [requested](https://github.com/matlab2tikz/matlab2tikz/labels/feature%20request) before and do join the relevant topic in that case or maybe it has already been implemented in the [latest development version](https://github.com/matlab2tikz/matlab2tikz/tree/develop).
If your feature is something new and graphical, please also have a look at the [`pgfplots`](https://www.ctan.org/pkg/pgfplots) manual to see if it supports the feature you want.
In some cases it is more constructive to request the feature in the [`pgfplots` bug tracker](https://sourceforge.net/p/pgfplots/bugs/).
Please submit you feature request as any [bug report](https://github.com/matlab2tikz/matlab2tikz/labels/feature%20request) and make sure that you include enough details in your post, e.g.:
- What are you trying to do?
- What should it look like or how should it work?
- Is there a relevant section in the `pgfplots` or `MATLAB` documentation?
## Submitting pull requests (PRs)
Before you start working on a bug or new feature, you might want to check that nobody else has been assigned to the relevant issue report.
To avoid wasted hours, please just indicate your interest to tackle the issue.
### Recommended workflow
[Our wiki](https://github.com/matlab2tikz/matlab2tikz/wiki/Recommended-git-workflow) contains more elaborate details on this process. Here is the gist:
- It is highly recommended to start a feature branch for your work.
- Once you have finished the work, please try to run the test suite and report on the outcome in your PR (see below).
- Make sure that you file your pull request against the `develop` branch and *not* the `master` branch!
- Once you have filed your PR, the review process starts. Everybody is free to join this discussion.
- At least one other developer will review the code and signal their approval (often using a thumbs-up, :+1:) before the PR gets pulled into `develop`.
- Once you have addressed all comments, one of the developers will merge your code into the `develop` branch.
If you still feel uncomfortable with `git`, please have a look at [this page](https://github.com/matlab2tikz/matlab2tikz/wiki/Learning-git) for a quick start.
### Running the test suite
We know that at first the test suite can seem a bit intimidating, so we tend to be lenient during your first few PRs. However, we encourage you to run the test suite on your local computer and report on the results in your PR if any failures pop up.
To run the test suite, please consult its [README](https://github.com/matlab2tikz/matlab2tikz/blob/develop/test/README.md).
## Becoming a member of [matlab2tikz](https://github.com/matlab2tikz)
Once you have submitted your first pull request that is of reasonable quality, you may get invited to join the [Associate Developers](https://github.com/orgs/matlab2tikz/teams/associate-developers) group.
This group comes with *no* responsibility whatsoever and merely serves to make it easier for you to "claim" the features you want to work on.
Once you have gained some experience (with `git`/GitHub, our codebase, ...) and have contributed your fair share of great material, you will get invited to join the [Developers](https://github.com/orgs/matlab2tikz/teams/developers) team.
This status gives you push access to our repository and hence comes with the responsibility to not abuse your push access.
If you feel you should have gotten an invite for a team, feel free to contact one of the [owners](https://github.com/orgs/matlab2tikz/teams/owners).

24
01_tex/figures/00_matlab_fcn/matlab2tikz/LICENSE.md

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
Copyright (c) 2008--2016 Nico Schlömer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

95
01_tex/figures/00_matlab_fcn/matlab2tikz/README.md

@ -0,0 +1,95 @@ @@ -0,0 +1,95 @@
**The updater in matlab2tikz 0.6.0 (and older) no longer works.**
**Please [update manually](http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz-matlab2tikz?download=true) if you are not using matlab2tikz 1.0.0 or newer!**
[![Build Status](https://travis-ci.org/matlab2tikz/matlab2tikz.svg?branch=master)](https://travis-ci.org/matlab2tikz/matlab2tikz) [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.18605.svg)](http://dx.doi.org/10.5281/zenodo.18605)
![matlab2tikz](https://raw.githubusercontent.com/wiki/matlab2tikz/matlab2tikz/matlab2tikz.png)
`matlab2tikz` is a MATLAB(R) script to convert native MATLAB(R) figures to TikZ/Pgfplots figures that integrate seamlessly in LaTeX documents.
To download the official releases and rate `matlab2tikz`, please visit its page on [FileExchange](http://www.mathworks.com/matlabcentral/fileexchange/22022).
`matlab2tikz` converts most MATLAB(R) figures, including 2D and 3D plots.
For plots constructed with third-party packages, however, your mileage may vary.
Installation
============
1. Extract the ZIP file (or clone the git repository) somewhere you can easily reach it.
2. Add the `src/` folder to your path in MATLAB/Octave: e.g.
- using the "Set Path" dialog in MATLAB, or
- by running the `addpath` function from your command window or `startup` script.
Make sure that your LaTeX installation is up-to-date and includes:
* [TikZ/PGF](http://www.ctan.org/pkg/pgf) version 3.0 or higher
* [Pgfplots](http://www.ctan.org/pkg/pgfplots) version 1.13 or higher
* [Amsmath](https://www.ctan.org/pkg/amsmath) version 2.14 or higher
* [Standalone](http://www.ctan.org/pkg/standalone) (optional)
It is recommended to use the latest stable version of these packages.
Older versions may work depending on the actual MATLAB(R) figure you are converting.
Usage
=====
Typical usage of `matlab2tikz` consists of converting your MATLAB plot to a TikZ/LaTeX file and then running a LaTeX compiler to produce your document.
MATLAB
------
1. Generate your plot in MATLAB(R).
2. Run `matlab2tikz`, e.g. using
```matlab
matlab2tikz('myfile.tex');
```
LaTeX
-----
Add the contents of `myfile.tex` into your LaTeX source code, for example using `\input{myfile.tex}`.
Make sure that the required packages (such as `pgfplots`) are loaded in the preamble of your document as in the example:
```latex
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
%% the following commands are needed for some matlab2tikz features
\usetikzlibrary{plotmarks}
\usetikzlibrary{arrows.meta}
\usepgfplotslibrary{patchplots}
\usepackage{grffile}
\usepackage{amsmath}
%% you may also want the following commands
%\pgfplotsset{plot coordinates/math parser=false}
%\newlength\figureheight
%\newlength\figurewidth
\begin{document}
\input{myfile.tex}
\end{document}
```
Remarks
-------
Most functions accept numerous options; you can check them out by inspecting their help:
```matlab
help matlab2tikz
```
Sometimes, MATLAB(R) plots contain some features that impede conversion to LaTeX; e.g. points that are far outside of the actual bounding box.
You can invoke the `cleanfigure` function to remove such unwanted entities before calling `matlab2tikz`:
```matlab
cleanfigure;
matlab2tikz('myfile.tex');
```
More information
================
* For more information about `matlab2tikz`, have a look at our [GitHub repository](https://github.com/matlab2tikz/matlab2tikz). If you are a good MATLAB(R) programmer or LaTeX writer, you are always welcome to help improving `matlab2tikz`!
* Some common problems and pit-falls are documented in our [wiki](https://github.com/matlab2tikz/matlab2tikz/wiki/Common-problems).
* If you experience (other) bugs or would like to request a feature, please visit our [issue tracker](https://github.com/matlab2tikz/matlab2tikz/issues).

102
01_tex/figures/00_matlab_fcn/matlab2tikz/logos/matlab2tikz.svg

@ -0,0 +1,102 @@ @@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="2083.4766"
height="856.6734"
id="svg3051"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="matlab2tikz.svg">
<defs
id="defs3053" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.5"
inkscape:cx="1424.8959"
inkscape:cy="275.08087"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1680"
inkscape:window-height="949"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="5"
fit-margin-left="5"
fit-margin-right="5"
fit-margin-bottom="5" />
<metadata
id="metadata3056">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(96.763877,-104.02549)">
<path
style="fill:#ef8200;fill-opacity:1;stroke:none"
d="m 229.79347,889.91953 c -51.20296,-69.53548 -110.45905,-150.5284 -117.8477,-161.07762 -3.66043,-5.22621 -4.15923,-6.45766 -2.93039,-7.23468 0.81449,-0.51503 2.1559,-0.94763 2.9809,-0.96134 4.45183,-0.074 21.84491,-16.50352 39.70528,-37.5057 64.93246,-76.3547 212.14442,-292.5117 313.27925,-460 28.45805,-47.12908 55.23448,-94.70724 59.01417,-107.81682 2.21373,-7.67817 3.30364,-4.58186 5.54982,7.259 0.84717,4.46595 9.42069,39.94343 19.05225,78.83886 61.4356,248.09709 88.96885,376.22196 95.45994,444.21896 1.34274,14.06576 0.80116,31.67542 -1.06339,34.57694 -0.67969,1.05768 -29.41344,23.07306 -63.85279,48.92306 -46.63668,35.00526 -216.41083,162.82778 -297.77739,224.19582 l -3.13285,2.36286 z"
id="path3072"
inkscape:connector-curvature="0" />
<path
style="fill:#ffd912;fill-opacity:1"
d="M 828.49628,790.87316 C 751.45425,746.41551 656.62349,689.46978 647.33146,682.08395 c -2.47911,-1.97053 -2.52321,-2.17947 -1.05805,-5.01277 3.18772,-6.16438 4.02557,-14.85566 3.44538,-35.74002 -0.80529,-28.98647 -5.98761,-65.55929 -17.38517,-122.69097 -18.80756,-94.27528 -55.9766,-241.89492 -91.4729,-363.29152 -4.95189,-16.93533 -13.8484,-44.15875 -13.64905,-44.7568 0.19935,-0.59804 7.77507,16.91106 10.71396,23.16944 14.72516,31.35732 169.10504,368.5638 262.04653,572.37888 18.81036,41.25 35.965,78.78344 38.1214,83.40766 2.15641,4.62421 3.80419,8.50202 3.66173,8.61735 -0.14245,0.11533 -6.10901,-3.16608 -13.25901,-7.29204 z"
id="path3070"
inkscape:connector-curvature="0" />
<path
style="fill:#00b0cf;fill-opacity:1"
d="M 98.496283,712.93087 C 76.224153,691.69469 25.659453,651.42885 -55.133796,590.59166 l -36.630081,-27.58239 14.630081,-4.80606 C 1.4604828e-5,532.86436 84.848253,489.14509 155.49628,438.33721 c 90.71369,-65.23848 211.18904,-171.14032 339.75,-298.65155 14.7125,-14.59237 30.24771,-31.09621 30.24771,-30.65137 0,1.46965 -5.56006,9.74411 -33.50167,53.6059 -117.938,185.13504 -236.74752,364.94776 -300.3065,454.5 -22.45559,31.6391 -46.86362,64.24839 -58.75719,78.5 -10.15154,12.16419 -23.13943,25.02746 -25.20109,24.95928 -0.6772,-0.0224 -4.83126,-3.47326 -9.231257,-7.6686 z"
id="path2987"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:256.08959961px;line-height:125%;font-family:'Monotype Corsiva';-inkscape-font-specification:'Monotype Corsiva Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#ef8200;fill-opacity:1;stroke:none"
x="835.56165"
y="469.78217"
id="text3863"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3865"
x="835.56165"
y="469.78217"
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Italic';fill:#000000;fill-opacity:1"><tspan
style="font-style:normal;-inkscape-font-specification:'Liberation Sans'"
id="tspan2999">MATLAB</tspan><tspan
style="font-style:italic;font-weight:bold;-inkscape-font-specification:'Liberation Sans Italic'"
id="tspan2997">2</tspan></tspan><tspan
sodipodi:role="line"
x="835.56165"
y="789.89417"
id="tspan3867"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#ef8200;fill-opacity:1"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#000000"
id="tspan3875">Ti</tspan><tspan
style="font-style:italic;-inkscape-font-specification:'Liberation Sans Italic'"
id="tspan2995">k</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#000000"
id="tspan3873">Z</tspan></tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

49
01_tex/figures/00_matlab_fcn/matlab2tikz/matlab2tikz.sublime-project vendored

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
{
"folders":
[
{
"path": "."
}
],
"build_systems":
[
{
"name": "CI tests (Octave)",
"selector": "source.matlab",
"working_dir": "${project_path}",
"cmd": ["./runtests.sh", "octave"]
},
{
"name": "CI tests (MATLAB)",
"selector": "source.matlab",
"working_dir": "${project_path}",
"cmd": ["./runtests.sh", "matlab"]
},
{
"name": "CI tests (MATLAB HG1)",
"selector": "source.matlab",
"working_dir": "${project_path}",
"cmd": ["./runtests.sh", "matlab-hg1"]
},
{
"name": "CI tests (MATLAB HG2)",
"selector": "source.matlab",
"working_dir": "${project_path}",
"cmd": ["./runtests.sh", "matlab-hg2"]
},
{
"name": "ACID: make",
"working_dir": "${project_path}/test/tex",
"cmd": ["make","-j8"]
},
{
"name": "ACID: distclean",
"working_dir": "${project_path}/test/tex",
"cmd": ["make","distclean"]
}
],
"settings":
{
"FuzzyFilePath":{}
}
}

86
01_tex/figures/00_matlab_fcn/matlab2tikz/runtests.sh

@ -0,0 +1,86 @@ @@ -0,0 +1,86 @@
#!/usr/bin/env bash
#
# Test script runner for MATLAB2TIKZ continuous integration
#
# You can influence the execution by passing one or two parameters
# to this function, as
#
# ./runtests.sh RUNNER SWITCHES
#
# Arguments:
# - RUNNER: (path of) the binary you want to use to execute the tests
# default value: "octave"
# - SWITCHES: switches you want to pass to the executable
# default value: * "-nodesktop -r" if runner contains "matlab"
# * "--no-gui --eval" if runner contains "octave" and otherwise
#
# Used resources:
# - http://askubuntu.com/questions/299710/how-to-determine-if-a-string-is-a-substring-of-another-in-bash
# - http://www.thegeekstuff.com/2010/07/bash-case-statement/
# - http://stackoverflow.com/questions/229551/string-contains-in-bash
# - http://stackoverflow.com/questions/2870992/automatic-exit-from-bash-shell-script-on-error
# - http://www.davidpashley.com/articles/writing-robust-shell-scripts/
# - http://stackoverflow.com/questions/13998941/how-can-i-propagate-an-exit-status-from-expect-to-its-parent-bash-script
# - http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-8.html
## Make sure some failures are detected by the CI runners
function exitIfError {
# pass "$?" as argument: i.e. the exit status of the last call
if [ "$1" -ne 0 ]; then
exit $1;
fi
}
## Handle Runner and Switches variables
Runner=$1
Switches=$2
if [ -z "$Runner" ] ; then
Runner="octave"
fi
if [ -z "$Switches" ] ; then
case "$Runner" in
*matlab* )
Switches="-nodesktop -r"
;;
*octave* )
Switches="--no-gui --eval"
;;
* )
# Fall back to Octave switches
Switches="--no-gui --eval"
;;
esac
fi
## Make sure MATLAB/Octave know the intent
# note: the export is required
export CONTINUOUS_INTEGRATION=true
export CI=true
## Actually run the test suite
cd test
TESTDIR=`pwd`
# also CD in MATLAB/Octave to make sure that startup files
# cannot play any role in setting the path
${Runner} ${Switches} "cd('${TESTDIR}'); runMatlab2TikzTests"
exitIfError $?
cd ..
## Post-processing
# convert MD report into HTML using pandoc if available
MDFILE="test/results.test.md"
if [ ! -z `which pandoc` ]; then
if [ -f $MDFILE ]; then
HTMLFILE=${MDFILE/md/html}
# replace the emoji while we're at it
pandoc -f markdown -t html $MDFILE -o $HTMLFILE
sed -i -- 's/:heavy_exclamation_mark:/❗/g' $HTMLFILE
sed -i -- 's/:white_check_mark:/✅/g' $HTMLFILE
sed -i -- 's/:grey_question:/❔/g' $HTMLFILE
fi
fi

1294
01_tex/figures/00_matlab_fcn/matlab2tikz/src/cleanfigure.m

File diff suppressed because it is too large Load Diff

87
01_tex/figures/00_matlab_fcn/matlab2tikz/src/dev/formatWhitespace.m

@ -0,0 +1,87 @@ @@ -0,0 +1,87 @@
function formatWhitespace(filename)
% FORMATWHITESPACE Formats whitespace and indentation of a document
%
% FORMATWHITESPACE(FILENAME)
% Indents currently active document if FILENAME is empty or not
% specified. FILENAME must be the name of an open document in the
% editor.
%
% Rules:
% - Smart-indent with all function indent option
% - Indentation is 4 spaces
% - Remove whitespace in empty lines
% - Preserve indentantion after line continuations, i.e. ...
%
import matlab.desktop.editor.*
if nargin < 1, filename = ''; end
d = getDoc(filename);
oldLines = textToLines(d.Text);
% Smart indent as AllFunctionIndent
% Using undocumented feature from http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically
editorProp = 'EditorMFunctionIndentType';
oldVal = com.mathworks.services.Prefs.getStringPref(editorProp);
com.mathworks.services.Prefs.setStringPref(editorProp, 'AllFunctionIndent');
restoreSettings = onCleanup(@() com.mathworks.services.Prefs.setStringPref(editorProp, oldVal));
d.smartIndentContents()
% Preserve crafted continuations of line
lines = textToLines(d.Text);
iContinuation = ~cellfun('isempty',strfind(lines, '...'));
iComment = ~cellfun('isempty',regexp(lines, '^ *%([^%]|$)','once'));
pAfterDots = find(iContinuation & ~iComment)+1;
for ii = 1:numel(pAfterDots)
% Carry over the change in space due to smart-indenting from the
% first continuation line to the last
p = pAfterDots(ii);
nWhiteBefore = find(~isspace(oldLines{p-1}),1,'first');
nWhiteAfter = find(~isspace(lines{p-1}),1,'first');
df = nWhiteAfter - nWhiteBefore;
if df > 0
lines{p} = [blanks(df) oldLines{p}];
elseif df < 0
df = min(abs(df)+1, find(~isspace(oldLines{p}),1,'first'));
lines{p} = oldLines{p}(df:end);
else
lines{p} = oldLines{p};
end
end
% Remove whitespace lines
idx = cellfun('isempty',regexp(lines, '[^ \t\n]','once'));
lines(idx) = {''};
d.Text = linesToText(lines);
end
function d = getDoc(filename)
import matlab.desktop.editor.*
if ~ischar(filename)
error('formatWhitespace:charFilename','The FILENAME should be a char.')
end
try
isEditorAvailable();
catch
error('formatWhitespace:noEditorApi','Check that the Editor API is available.')
end
if isempty(filename)
d = getActive();
else
% TODO: open file if it isn't open in the editor already
d = findOpenDocument(filename);
try
[~,filenameFound] = fileparts(d.Filename);
catch
filenameFound = '';
end
isExactMatch = strcmp(filename, filenameFound);
if ~isExactMatch
error('formatWhitespace:filenameNotFound','Filename "%s" not found in the editor.', filename)
end
end
end

123
01_tex/figures/00_matlab_fcn/matlab2tikz/src/figure2dot.m

@ -0,0 +1,123 @@ @@ -0,0 +1,123 @@
function figure2dot(filename, varargin)
%FIGURE2DOT Save figure in Graphviz (.dot) file.
% FIGURE2DOT(filename) saves the current figure as dot-file.
%
% FIGURE2DOT(filename, 'object', HGOBJECT) constructs the graph representation
% of the specified object (default: gcf)
%
% You can visualize the constructed DOT file using:
% - [GraphViz](http://www.graphviz.org) on your computer
% - [WebGraphViz](http://www.webgraphviz.com) online
% - [Gravizo](http://www.gravizo.com) for your markdown files
% - and a lot of other software such as OmniGraffle
%
% See also: matlab2tikz, cleanfigure, uiinspect, inspect
ipp = m2tInputParser();
ipp = ipp.addRequired(ipp, 'filename', @ischar);
ipp = ipp.addParamValue(ipp, 'object', gcf, @ishghandle);
ipp = ipp.parse(ipp, filename, varargin{:});
args = ipp.Results;
filehandle = fopen(args.filename, 'w');
finally_fclose_filehandle = onCleanup(@() fclose(filehandle));
% start printing
fprintf(filehandle, 'digraph simple_hierarchy {\n\n');
fprintf(filehandle, 'node[shape=box];\n\n');
% define the root node
node_number = 0;
p = get(args.object, 'Parent');
% define root element
type = get(p, 'Type');
fprintf(filehandle, 'N%d [label="%s"]\n\n', node_number, type);
% start recursion
plot_children(filehandle, p, node_number);
% finish off
fprintf(filehandle, '}');
% ----------------------------------------------------------------------------
function plot_children(fh, h, parent_node)
children = allchild(h);
for h = children(:)'
if shouldSkip(h), continue, end;
node_number = node_number + 1;
label = {};
label = addHGProperty(label, h, 'Type', '');
try
hClass = class(handle(h));
label = addProperty(label, 'Class', hClass);
catch
% don't do anything
end
label = addProperty(label, 'Handle', sprintf('%g', double(h)));
label = addHGProperty(label, h, 'Title', '');
label = addHGProperty(label, h, 'Axes', []);
label = addHGProperty(label, h, 'String', '');
label = addHGProperty(label, h, 'Tag', '');
label = addHGProperty(label, h, 'DisplayName', '');
label = addHGProperty(label, h, 'Visible', 'on');
label = addHGProperty(label, h, 'HandleVisibility', 'on');
% print node
fprintf(fh, 'N%d [label="%s"]\n', ...
node_number, m2tstrjoin(label, '\n'));
% connect to the child
fprintf(fh, 'N%d -> N%d;\n\n', parent_node, node_number);
% recurse
plot_children(fh, h, node_number);
end
end
end
% ==============================================================================
function bool = shouldSkip(h)
% returns TRUE for objects that can be skipped
objType = get(h, 'Type');
bool = ismember(lower(objType), guitypes());
end
% ==============================================================================
function label = addHGProperty(label, h, propName, default)
% get a HG property and assign it to a GraphViz node label
if ~exist('default','var') || isempty(default)
shouldOmit = @isempty;
elseif isa(default, 'function_handle')
shouldOmit = default;
else
shouldOmit = @(v) isequal(v,default);
end
if isprop(h, propName)
propValue = get(h, propName);
if numel(propValue) == 1 && ishghandle(propValue) && isprop(propValue, 'String')
% dereference Titles, labels, ...
propValue = get(propValue, 'String');
elseif ishghandle(propValue)
% dereference other HG objects to their raw handle value (double)
propValue = double(propValue);
elseif iscell(propValue)
propValue = ['{' m2tstrjoin(propValue,',') '}'];
end
if ~shouldOmit(propValue)
label = addProperty(label, propName, propValue);
end
end
end
function label = addProperty(label, propName, propValue)
% add a property to a GraphViz node label
if isnumeric(propValue)
propValue = num2str(propValue);
elseif iscell(propValue)
propValue = m2tstrjoin(propValue,sprintf('\n'));
end
label = [label, sprintf('%s: %s', propName, propValue)];
end
% ==============================================================================

231
01_tex/figures/00_matlab_fcn/matlab2tikz/src/m2tInputParser.m

@ -0,0 +1,231 @@ @@ -0,0 +1,231 @@
function parser = m2tInputParser()
%MATLAB2TIKZINPUTPARSER Input parsing for matlab2tikz.
% This implementation exists because Octave is lacking one.
% Initialize the structure.
parser = struct ();
% Public Properties
parser.Results = {};
% Enabel/disable parameters case sensitivity.
parser.CaseSensitive = false;
% Keep parameters not defined by the constructor.
parser.KeepUnmatched = false;
% Enable/disable warning for parameters not defined by the constructor.
parser.WarnUnmatched = true;
% Enable/disable passing arguments in a structure.
parser.StructExpand = true;
% Names of parameters defined in input parser constructor.
parser.Parameters = {};
% Names of parameters not defined in the constructor.
parser.Unmatched = struct ();
% Names of parameters using default values.
parser.UsingDefaults = {};
% Names of deprecated parameters and their alternatives
parser.DeprecatedParameters = struct();
% Handles for functions that act on the object.
parser.addRequired = @addRequired;
parser.addOptional = @addOptional;
parser.addParamValue = @addParamValue;
parser.deprecateParam = @deprecateParam;
parser.parse = @parse;
% Initialize the parser plan
parser.plan = {};
end
% =========================================================================
function p = parser_plan (q, arg_type, name, default, validator)
p = q;
plan = p.plan;
if (isempty (plan))
plan = struct ();
n = 1;
else
n = numel (plan) + 1;
end
plan(n).type = arg_type;
plan(n).name = name;
plan(n).default = default;
plan(n).validator = validator;
p.plan = plan;
end
% =========================================================================
function p = addRequired (p, name, validator)
p = parser_plan (p, 'required', name, [], validator);
end
% =========================================================================
function p = addOptional (p, name, default, validator)
p = parser_plan (p, 'optional', name, default, validator);
end
% =========================================================================
function p = addParamValue (p, name, default, validator)
p = parser_plan (p, 'paramvalue', name, default, validator);
end
% =========================================================================
function p = deprecateParam (p, name, alternatives)
if isempty(alternatives)
alternatives = {};
elseif ischar(alternatives)
alternatives = {alternatives}; % make cellstr
elseif ~iscellstr(alternatives)
error('m2tInputParser:BadAlternatives',...
'Alternatives for a deprecated parameter must be a char or cellstr');
end
p.DeprecatedParameters.(name) = alternatives;
end
% =========================================================================
function p = parse (p, varargin)
plan = p.plan;
results = p.Results;
using_defaults = {};
if (p.CaseSensitive)
name_cmp = @strcmp;
else
name_cmp = @strcmpi;
end
if (p.StructExpand)
k = find (cellfun (@isstruct, varargin));
for m = numel(k):-1:1
n = k(m);
s = varargin{n};
c = [fieldnames(s).'; struct2cell(s).'];
c = c(:).';
if (n > 1 && n < numel (varargin))
varargin = horzcat (varargin(1:n-1), c, varargin(n+1:end));
elseif (numel (varargin) == 1)
varargin = c;
elseif (n == 1);
varargin = horzcat (c, varargin(n+1:end));
else % n == numel (varargin)
varargin = horzcat (varargin(1:n-1), c);
end
end
end
if (isempty (results))
results = struct ();
end
type = {plan.type};
n = find( strcmp( type, 'paramvalue' ) );
m = setdiff (1:numel( plan ), n );
plan = plan ([n,m]);
for n = 1 : numel (plan)
found = false;
results.(plan(n).name) = plan(n).default;
if (~ isempty (varargin))
switch plan(n).type
case 'required'
found = true;
if (strcmpi (varargin{1}, plan(n).name))
varargin(1) = [];
end
value = varargin{1};
varargin(1) = [];
case 'optional'
m = find (cellfun (@ischar, varargin));
k = find (name_cmp (plan(n).name, varargin(m)));
if (isempty (k) && validate_arg (plan(n).validator, varargin{1}))
found = true;
value = varargin{1};
varargin(1) = [];
elseif (~ isempty (k))
m = m(k);
found = true;
value = varargin{max(m)+1};
varargin(union(m,m+1)) = [];
end
case 'paramvalue'
m = find( cellfun (@ischar, varargin) );
k = find (name_cmp (plan(n).name, varargin(m)));
if (~ isempty (k))
found = true;
m = m(k);
value = varargin{max(m)+1};
varargin(union(m,m+1)) = [];
end
otherwise
error( sprintf ('%s:parse', mfilename), ...
'parse (%s): Invalid argument type.', mfilename ...
)
end
end
if (found)
if (validate_arg (plan(n).validator, value))
results.(plan(n).name) = value;
else
error( sprintf ('%s:invalidinput', mfilename), ...
'%s: Input argument ''%s'' has invalid value.\n', mfilename, plan(n).name ...
);
end
p.Parameters = union (p.Parameters, {plan(n).name});
elseif (strcmp (plan(n).type, 'required'))
error( sprintf ('%s:missinginput', mfilename), ...
'%s: input ''%s'' is missing.\n', mfilename, plan(n).name ...
);
else
using_defaults = union (using_defaults, {plan(n).name});
end
end
if ~isempty(varargin)
% Include properties that do not match specified properties
for n = 1:2:numel(varargin)
if ischar(varargin{n})
if p.KeepUnmatched
results.(varargin{n}) = varargin{n+1};
end
if p.WarnUnmatched
warning(sprintf('%s:unmatchedArgument',mfilename), ...
'Ignoring unknown argument "%s"', varargin{n});
end
p.Unmatched.(varargin{n}) = varargin{n+1};
else
error (sprintf ('%s:invalidinput', mfilename), ...
'%s: invalid input', mfilename)
end
end
end
% Store the results of the parsing
p.Results = results;
p.UsingDefaults = using_defaults;
warnForDeprecatedParameters(p);
end
% =========================================================================
function result = validate_arg (validator, arg)
try
result = validator (arg);
catch %#ok
result = false;
end
end
% =========================================================================
function warnForDeprecatedParameters(p)
usedDeprecatedParameters = intersect(p.Parameters, fieldnames(p.DeprecatedParameters));
for iParam = 1:numel(usedDeprecatedParameters)
oldParameter = usedDeprecatedParameters{iParam};
alternatives = p.DeprecatedParameters.(oldParameter);
switch numel(alternatives)
case 0
replacements = '';
case 1
replacements = ['''' alternatives{1} ''''];
otherwise
replacements = deblank(sprintf('''%s'' and ',alternatives{:}));
replacements = regexprep(replacements,' and$','');
end
if ~isempty(replacements)
replacements = sprintf('From now on, please use %s to control the output.\n',replacements);
end
message = ['\n===============================================================================\n', ...
'You are using the deprecated parameter ''%s''.\n', ...
'%s', ...
'==============================================================================='];
warning('matlab2tikz:deprecatedParameter', ...
message, oldParameter, replacements);
end
end

6805
01_tex/figures/00_matlab_fcn/matlab2tikz/src/matlab2tikz.m

File diff suppressed because it is too large Load Diff

5
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/errorUnknownEnvironment.m

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
function errorUnknownEnvironment()
% Throw an error to indicate an unknwon environment (i.e. not MATLAB/Octave).
error('matlab2tikz:unknownEnvironment',...
'Unknown environment "%s". Need MATLAB(R) or Octave.', getEnvironment);
end

25
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/getEnvironment.m

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
function [env, versionString] = getEnvironment()
% Determine environment (Octave, MATLAB) and version string
% TODO: Unify private `getEnvironment` functions
persistent cache
if isempty(cache)
isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;
if isOctave
env = 'Octave';
versionString = OCTAVE_VERSION;
else
env = 'MATLAB';
vData = ver(env);
versionString = vData.Version;
end
% store in cache
cache.env = env;
cache.versionString = versionString;
else
env = cache.env;
versionString = cache.versionString;
end
end

13
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/guitypes.m

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
function types = guitypes()
% GUITYPES returns a cell array of MATLAB/Octave GUI object types
%
% Syntax
% types = guitypes()
%
% These types are ignored by matlab2tikz and figure2dot.
%
% See also: matlab2tikz, figure2dot
types = {'uitoolbar', 'uimenu', 'uicontextmenu', 'uitoggletool',...
'uitogglesplittool', 'uipushtool', 'hgjavacomponent'};
end

5
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/isAxis3D.m

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
function bool = isAxis3D(axisHandle)
% Check if elevation is not orthogonal to xy plane
axisView = get(axisHandle,'view');
bool = ~ismember(axisView(2),[90,-90]);
end

13
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/isVersionBelow.m

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
function isBelow = isVersionBelow(versionA, versionB)
% Checks if versionA is smaller than versionB
vA = versionArray(versionA);
vB = versionArray(versionB);
n = min(length(vA), length(vB));
deltaAB = vA(1:n) - vB(1:n);
difference = find(deltaAB, 1, 'first');
if isempty(difference)
isBelow = false; % equal versions
else
isBelow = (deltaAB(difference) < 0);
end
end

310
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/m2tUpdater.m

@ -0,0 +1,310 @@ @@ -0,0 +1,310 @@
function m2tUpdater(about, verbose)
%UPDATER Auto-update matlab2tikz.
% Only for internal usage.
% Copyright (c) 2012--2014, Nico Schlömer <nico.schloemer@gmail.com>
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:
%
% * Redistributions of source code must retain the above copyright
% notice, this list of conditions and the following disclaimer.
% * Redistributions in binary form must reproduce the above copyright
% notice, this list of conditions and the following disclaimer in
% the documentation and/or other materials provided with the distribution
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.
% =========================================================================
fileExchangeUrl = about.website;
version = about.version;
mostRecentVersion = determineLatestRelease(version, fileExchangeUrl);
if askToUpgrade(mostRecentVersion, version, verbose)
tryToUpgrade(fileExchangeUrl, verbose);
userInfo(verbose, '');
end
end
% ==============================================================================
function shouldUpgrade = askToUpgrade(mostRecentVersion, version, verbose)
shouldUpgrade = false;
if ~isempty(mostRecentVersion)
userInfo(verbose, '**********************************************\n');
userInfo(verbose, 'New version (%s) available!\n', mostRecentVersion);
userInfo(verbose, '**********************************************\n');
warnAboutUpgradeImplications(version, mostRecentVersion, verbose);
askToShowChangelog(version);
reply = input(' *** Would you like to upgrade? y/n [n]:','s');
shouldUpgrade = ~isempty(reply) && strcmpi(reply(1),'y');
if ~shouldUpgrade
userInfo(verbose, ['\nTo disable the self-updater in the future, add ' ...
'"''checkForUpdates'',false" to the parameters.\n'] );
end
end
end
% ==============================================================================
function tryToUpgrade(fileExchangeUrl, verbose)
% Download the files and unzip its contents into two folders
% above the folder that contains the current script.
% This assumes that the file structure is something like
%
% src/matlab2tikz.m
% src/[...]
% src/private/m2tUpdater
% src/private/[...]
% AUTHORS
% ChangeLog
% [...]
%
% on the hard drive and the zip file. In particular, this assumes
% that the folder on the hard drive is writable by the user
% and that matlab2tikz.m is not symlinked from some other place.
pathstr = fileparts(mfilename('fullpath'));
targetPath = fullfile(pathstr, '..', '..');
% Let the user know where the .zip is downloaded to
userInfo(verbose, 'Downloading and unzipping to ''%s'' ...', targetPath);
% Try upgrading
try
% List current folder structure. Will use last for cleanup
currentFolderFiles = rdirfiles(targetPath);
% The FEX now forwards the download request to Github.
% Go through the forwarding to update the download count and
% unzip
html = urlread([fileExchangeUrl, '?download=true']);
expression = '(?<=\<a href=")[\w\-\/:\.]+(?=">redirected)';
url = regexp(html, expression,'match','once');
unzippedFiles = unzip(url, targetPath);
% The folder structure is additionally packed into the
% 'MATLAB Search Path' folder defined in FEX. Retrieve the
% top folder name
tmp = strrep(unzippedFiles,[targetPath, filesep],'');
tmp = regexp(tmp, filesep,'split','once');
tmp = cat(1,tmp{:});
topZipFolder = unique(tmp(:,1));
% If packed into the top folder, overwrite files into m2t
% main directory
if numel(topZipFolder) == 1
unzippedFilesTarget = fullfile(targetPath, tmp(:,2));
for ii = 1:numel(unzippedFiles)
movefile(unzippedFiles{ii}, unzippedFilesTarget{ii})
end
% Add topZipFolder to current folder structure
currentFolderFiles = [currentFolderFiles; fullfile(targetPath, topZipFolder{1})];
end
cleanupOldFiles(currentFolderFiles, unzippedFilesTarget);
userInfo(verbose, 'Upgrade has completed successfully.');
catch
err = lasterror(); %#ok needed for Octave
userInfo(verbose, ...
['Upgrade has failed with error message "%s".\n', ...
'Please install the latest version manually from %s !'], ...
err.message, fileExchangeUrl);
end
end
% ==============================================================================
function cleanupOldFiles(currentFolderFiles, unzippedFilesTarget)
% Delete files that were there in the old folder, but that are no longer
% present in the new release.
newFolderStructure = [getFolders(unzippedFilesTarget); unzippedFilesTarget];
deleteFolderFiles = setdiff(currentFolderFiles, newFolderStructure);
for ii = 1:numel(deleteFolderFiles)
x = deleteFolderFiles{ii};
if exist(x, 'dir') == 7
% First check for directories since
% `exist(x, 'file')` also checks for directories!
rmdir(x,'s');
elseif exist(x, 'file') == 2
delete(x);
end
end
end
% ==============================================================================
function mostRecentVersion = determineLatestRelease(version, fileExchangeUrl)
% Read in the Github releases page
url = 'https://github.com/matlab2tikz/matlab2tikz/releases/';
try
html = urlread(url);
catch %#ok
% Couldn't load the URL -- never mind.
html = '';
warning('m2tUpdate:siteNotFound', ...
['Cannot determine the latest version.\n', ...
'Either your internet is down or something went wrong.\n', ...
'You might want to check for updates by hand at %s.\n'], ...
fileExchangeUrl);
end
% Parse tag names which are the version number in the format ##.##.##
% It assumes that releases will always be tagged with the version number
expression = '(?<=matlab2tikz\/matlab2tikz\/releases\/tag\/)\d+\.\d+\.\d+';
tags = regexp(html, expression, 'match');
ntags = numel(tags);
% Keep only new releases
inew = false(ntags,1);
for ii = 1:ntags
inew(ii) = isVersionBelow(version, tags{ii});
end
nnew = nnz(inew);
% One new release
if nnew == 1
mostRecentVersion = tags{inew};
% Several new release, pick latest
elseif nnew > 1
tags = tags(inew);
tagnum = zeros(nnew,1);
for ii = 1:nnew
tagnum(ii) = [10000,100,1] * versionArray(tags{ii});
end
[~, imax] = max(tagnum);
mostRecentVersion = tags{imax};
% No new
else
mostRecentVersion = '';
end
end
% ==============================================================================
function askToShowChangelog(currentVersion)
% Asks whether the user wants to see the changelog and then shows it.
reply = input(' *** Would you like to see the changelog? y/n [y]:' ,'s');
shouldShow = isempty(reply) || ~strcmpi(reply(1),'n') ;
if shouldShow
fprintf(1, '\n%s\n', changelogUntilVersion(currentVersion));
end
end
% ==============================================================================
function changelog = changelogUntilVersion(currentVersion)
% This function retrieves the chunk of the changelog until the current version.
URL = 'https://github.com/matlab2tikz/matlab2tikz/raw/master/CHANGELOG.md';
changelog = urlread(URL);
currentVersion = versionString(currentVersion);
% Header is "# YYYY-MM-DD Version major.minor.patch [Manager](email)"
% Just match for the part until the version number. Here, we're actually
% matching a tiny bit too broad due to the periods in the version number
% but the outcome should be the same if we keep the changelog format
% identical.
pattern = ['\#\s*[\d-]+\s*Version\s*' currentVersion];
idxVersion = regexpi(changelog, pattern);
if ~isempty(idxVersion)
changelog = changelog(1:idxVersion-1);
else
% Just show the whole changelog if we don't find the old version.
end
end
% ==============================================================================
function warnAboutUpgradeImplications(currentVersion, latestVersion, verbose)
% This warns the user about the implications of upgrading as dictated by
% Semantic Versioning.
switch upgradeSize(currentVersion, latestVersion);
case 'major'
% The API might have changed in a backwards incompatible way.
userInfo(verbose, 'This is a MAJOR upgrade!\n');
userInfo(verbose, ' - New features may have been introduced.');
userInfo(verbose, ' - Some old code/options may no longer work!\n');
case 'minor'
% The API may NOT have changed in a backwards incompatible way.
userInfo(verbose, 'This is a MINOR upgrade.\n');
userInfo(verbose, ' - New features may have been introduced.');
userInfo(verbose, ' - Some options may have been deprecated.');
userInfo(verbose, ' - Old code should continue to work but might produce warnings.\n');
case 'patch'
% No new functionality is introduced
userInfo(verbose, 'This is a PATCH.\n');
userInfo(verbose, ' - Only bug fixes are included in this upgrade.');
userInfo(verbose, ' - Old code should continue to work as before.')
end
userInfo(verbose, 'Please check the changelog for detailed information.\n');
userWarn(verbose, '\n!! By upgrading you will lose any custom changes !!\n');
end
% ==============================================================================
function cls = upgradeSize(currentVersion, latestVersion)
% Determines whether the upgrade is major, minor or a patch.
currentVersion = versionArray(currentVersion);
latestVersion = versionArray(latestVersion);
description = {'major', 'minor', 'patch'};
for ii = 1:numel(description)
if latestVersion(ii) > currentVersion(ii)
cls = description{ii};
return
end
end
cls = 'unknown';
end
% ==============================================================================
function userInfo(verbose, message, varargin)
% Display information (i.e. to stdout)
if verbose
userPrint(1, message, varargin{:});
end
end
function userWarn(verbose, message, varargin)
% Display warnings (i.e. to stderr)
if verbose
userPrint(2, message, varargin{:});
end
end
function userPrint(fid, message, varargin)
% Print messages (info/warnings) to a stream/file.
mess = sprintf(message, varargin{:});
% Replace '\n' by '\n *** ' and print.
mess = strrep( mess, sprintf('\n'), sprintf('\n *** ') );
fprintf(fid, ' *** %s\n', mess );
end
% =========================================================================
function list = rdirfiles(rootdir)
% Recursive files listing
s = dir(rootdir);
list = {s.name}';
% Exclude .git, .svn, . and ..
[list, idx] = setdiff(list, {'.git','.svn','.','..'});
% Add root
list = fullfile(rootdir, list);
% Loop for sub-directories
pdir = find([s(idx).isdir]);
for ii = pdir
list = [list; rdirfiles(list{ii})]; %#ok<AGROW>
end
% Drop directories
list(pdir) = [];
end
% =========================================================================
function list = getFolders(list)
% Extract the folder structure from a list of files and folders
for ii = 1:numel(list)
if exist(list{ii},'file') == 2
list{ii} = fileparts(list{ii});
end
end
list = unique(list);
end
% =========================================================================

35
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/m2tstrjoin.m

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
function newstr = m2tstrjoin(cellstr, delimiter, floatFormat)
% This function joins a cell of strings to a single string (with a
% given delimiter in between two strings, if desired).
if ~exist('delimiter','var') || isempty(delimiter)
delimiter = '';
end
if ~exist('floatFormat','var') || isempty(floatFormat)
floatFormat = '%g';
end
if isempty(cellstr)
newstr = '';
return
end
% convert all values to strings first
nElem = numel(cellstr);
for k = 1:nElem
if isnumeric(cellstr{k})
cellstr{k} = sprintf(floatFormat, cellstr{k});
elseif iscell(cellstr{k})
cellstr{k} = m2tstrjoin(cellstr{k}, delimiter, floatFormat);
% this will fail for heavily nested cells
elseif ~ischar(cellstr{k})
error('matlab2tikz:join:NotCellstrOrNumeric',...
'Expected cellstr or numeric.');
end
end
% inspired by strjoin of recent versions of MATLAB
newstr = cell(2,nElem);
newstr(1,:) = reshape(cellstr, 1, nElem);
newstr(2,1:nElem-1) = {delimiter}; % put delimiters in-between the elements
newstr(2,end) = {''}; % for Octave 4 compatibility
newstr = [newstr{:}];
end

18
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/versionArray.m

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
function arr = versionArray(str)
% Converts a version string to an array.
if ischar(str)
% Translate version string from '2.62.8.1' to [2; 62; 8; 1].
switch getEnvironment
case 'MATLAB'
split = regexp(str, '\.', 'split'); % compatibility MATLAB < R2013a
case 'Octave'
split = strsplit(str, '.');
otherwise
errorUnknownEnvironment();
end
arr = str2num(char(split)); %#ok
else
arr = str;
end
arr = arr(:)';
end

9
01_tex/figures/00_matlab_fcn/matlab2tikz/src/private/versionString.m

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
function str = versionString(arr)
% Converts a version array to string
if ischar(arr)
str = arr;
elseif isnumeric(arr)
str = sprintf('%d.', arr);
str = str(1:end-1); % remove final period
end
end

101
01_tex/figures/00_matlab_fcn/matlab2tikz/test/README.md

@ -0,0 +1,101 @@ @@ -0,0 +1,101 @@
This test module is part of matlab2tikz.
Its use is mainly of interest to the matlab2tikz developers to assert that the produced output is good.
Ideally, the tests should be run on every supported environment, i.e.:
* MATLAB R2014a/8.3 (or an older version)
* MATLAB R2014b/8.4 (or a newer version)
* Octave 3.8
Preparing your environment
==========================
Before you can run the tests, you need to make sure that you have all relevant
functions available on your path. From within the `/test` directory run the
following code in your MATLAB/Octave console:
```matlab
addpath(pwd); % for the test harness
addpath(fullfile(pwd,'..','src')); % for matlab2tikz
addpath(fullfile(pwd,'suites')); % for the test suites
```
Running the tests
=================
We have two kinds of tests runners available that each serve a slightly different
purpose.
* "Graphical" tests produce an output report that graphically shows test
figures as generated by MATLAB/Octave and our TikZ output.
* "Headless" tests do not produce graphical output, but instead check the MD5
hash of the generated TikZ files to make sure that the same output
as before is generated.
It is recommended to run the headless tests first and check the problems in
the graphical tests afterwards.
Headless tests
--------------
These tests check that the TikZ output file produced by `matlab2tikz` matches
a reference output. The actual checking is done by hashing the file and the
corresponding hashes are stored in `.md5` files next to the test suites.
For each environment, different reference hashes can be stored.
The headless tests can be invoked using
```matlab
testHeadless;
```
, or, equivalently,
```matlab
makeTravisReport(testHeadless)
```
There are some caveats for this method of testing:
* The MD5 hash is extremely brittle to small details in the output: e.g.
extra whitespace or some other characters will change the hash.
* This automated test does NOT test whether the output is desirable or not.
It only checks whether the previous output is not altered!
* Hence, when structural changes are made, the reference hash should be changed.
This SHOULD be motivated in the pull request (e.g. with a picture)!
Graphical tests
---------------
These tests allow easy comparison of a native PDF `print` output and the
output produced by `matlab2tikz`. For the large amount of cases, however,
this comparison has become somewhat unwieldy.
You can execute the tests using
```matlab
testGraphical;
```
or, equivalently,
```matlab
makeLatexReport(testGraphical)
```
This generates a LaTeX report in `test/output/current/acid.tex` which can then be compiled.
Compilation of this file can be done using the Makefile `test/output/current/Makefile` if you are on a Unix-like system (OS X, Linux) or have [Cygwin](https://www.cygwin.com) installed on Windows.
If all goes well, the result will be the file `test/output/current/acid.pdf` that contains
a list of the test figures, exported as PDF and right next to it the matlab2tikz generated plot.
Advanced Use
------------
Both `testHeadless` and `testGraphical` can take multiple arguments, those are documented in the raw test runner `testMatlab2tikz` that is used behind the scenes. Note that this file sits in a private directory, so `help testMatlab2tikz` will not work!
Also, both can be called with a single output argument, for programmatical
access to the test results as
```matlab
status = testHeadless()
```
These test results in `status` can be passed to `saveHashTable` for updating the hash tables.
Obviously, this should be done with the due diligence!
Automated Tests
===============
The automated tests run on [Travis-CI](https://travis-ci.org) for Octave and on a [personal Jenkins server](https://github.com/matlab2tikz/matlab2tikz/wiki/Jenkins) for MATLAB.
These are effectively the "headless" tests that get called by the `runMatlab2TikzTests` function.
Without verification of those automated tests, a pull request is unlikely to get merged.

280
01_tex/figures/00_matlab_fcn/matlab2tikz/test/codeReport.m

@ -0,0 +1,280 @@ @@ -0,0 +1,280 @@
function [ report ] = codeReport( varargin )
%CODEREPORT Builds a report of the code health
%
% This function generates a Markdown report on the code health. At the moment
% this is limited to the McCabe (cyclomatic) complexity of a function and its
% subfunctions.
%
% This makes use of |checkcode| in MATLAB.
%
% Usage:
%
% CODEREPORT('function', functionName) to determine which function is
% analyzed. (default: matlab2tikz)
%
% CODEREPORT('complexityThreshold', integer ) to set above which complexity, a
% function is added to the report (default: 10)
%
% CODEREPORT('stream', stream) to set to which stream/file to output the report
% (default: 1, i.e. stdout). The stream is used only when no output argument
% for `codeReport` is specified!.
%
% See also: checkcode, mlint
SM = StreamMaker();
%% input options
ipp = m2tInputParser();
ipp = ipp.addParamValue(ipp, 'function', 'matlab2tikz', @ischar);
ipp = ipp.addParamValue(ipp, 'complexityThreshold', 10, @isnumeric);
ipp = ipp.addParamValue(ipp, 'stream', 1, SM.isStream);
ipp = ipp.parse(ipp, varargin{:});
stream = SM.make(ipp.Results.stream, 'w');
%% generate report data
data = checkcode(ipp.Results.function,'-cyc','-struct');
[complexityAll, mlintMessages] = splitCycloComplexity(data);
%% analyze cyclomatic complexity
categorizeComplexity = @(x) categoryOfComplexity(x, ...
ipp.Results.complexityThreshold, ...
ipp.Results.function);
complexityAll = arrayfun(@parseCycloComplexity, complexityAll);
complexityAll = arrayfun(categorizeComplexity, complexityAll);
complexity = filter(complexityAll, @(x) strcmpi(x.category, 'Bad'));
complexity = sortBy(complexity, 'line', 'ascend');
complexity = sortBy(complexity, 'complexity', 'descend');
[complexityStats] = complexityStatistics(complexityAll);
%% analyze other messages
%TODO: handle all mlint messages and/or other metrics of the code
%% format report
dataStr = complexity;
dataStr = arrayfun(@(d) mapField(d, 'function', @markdownInlineCode), dataStr);
if ~isempty(dataStr)
dataStr = addFooterRow(dataStr, 'complexity', @sum, {'line',0, 'function',bold('Total')});
end
dataStr = arrayfun(@(d) mapField(d, 'line', @integerToString), dataStr);
dataStr = arrayfun(@(d) mapField(d, 'complexity', @integerToString), dataStr);
report = makeTable(dataStr, {'function', 'complexity'}, ...
{'Function', 'Complexity'});
%% command line usage
if nargout == 0
if ismember(stream.name, {'stdout','stderr'})
stream.print('%s\n', codelinks(report, ipp.Results.function));
else
stream.print('%s\n', report);
end
figure('name',sprintf('Complexity statistics of %s', ipp.Results.function));
h = statisticsPlot(complexityStats, 'Complexity', 'Number of functions');
for hh = h
plot(hh, [1 1]*ipp.Results.complexityThreshold, ylim(hh), ...
'k--','DisplayName','Threshold');
end
legend(h(1),'show','Location','NorthEast');
clear report
end
end
%% CATEGORIZATION ==============================================================
function [complexity, others] = splitCycloComplexity(list)
% splits codereport into McCabe complexity and others
filter = @(l) ~isempty(strfind(l.message, 'McCabe complexity'));
idxComplexity = arrayfun(filter, list);
complexity = list( idxComplexity);
others = list(~idxComplexity);
end
function [data] = categoryOfComplexity(data, threshold, mainFunc)
% categorizes the complexity as "Good", "Bad" or "Accepted"
TOKEN = '#COMPLEX'; % token to signal allowed complexity
try %#ok
helpStr = help(sprintf('%s>%s', mainFunc, data.function));
if ~isempty(strfind(helpStr, TOKEN))
data.category = 'Accepted';
return;
end
end
if data.complexity > threshold
data.category = 'Bad';
else
data.category = 'Good';
end
end
%% PARSING =====================================================================
function [out] = parseCycloComplexity(in)
% converts McCabe complexity report strings into a better format
out = regexp(in.message, ...
'The McCabe complexity of ''(?<function>[A-Za-z0-9_]+)'' is (?<complexity>[0-9]+).', ...
'names');
out.complexity = str2double(out.complexity);
out.line = in.line;
end
%% DATA PROCESSING =============================================================
function selected = filter(list, filterFunc)
% filters an array according to a binary function
idx = logical(arrayfun(filterFunc, list));
selected = list(idx);
end
function [data] = mapField(data, field, mapping)
data.(field) = mapping(data.(field));
end
function sorted = sortBy(list, fieldName, mode)
% sorts a struct array by a single field
% extra arguments are as for |sort|
values = arrayfun(@(m)m.(fieldName), list);
[dummy, idxSorted] = sort(values(:), 1, mode); %#ok
sorted = list(idxSorted);
end
function [stat] = complexityStatistics(list)
% calculate some basic statistics of the complexities
stat.values = arrayfun(@(c)(c.complexity), list);
stat.binCenter = sort(unique(stat.values));
categoryPerElem = {list.category};
stat.categories = unique(categoryPerElem);
nCategories = numel(stat.categories);
groupedHist = zeros(numel(stat.binCenter), nCategories);
for iCat = 1:nCategories
category = stat.categories{iCat};
idxCat = ismember(categoryPerElem, category);
groupedHist(:,iCat) = hist(stat.values(idxCat), stat.binCenter);
end
stat.histogram = groupedHist;
stat.median = median(stat.values);
end
function [data] = addFooterRow(data, column, func, otherFields)
% adds a footer row to data table based on calculations of a single column
footer = data(end);
for iField = 1:2:numel(otherFields)
field = otherFields{iField};
value = otherFields{iField+1};
footer.(field) = value;
end
footer.(column) = func([data(:).(column)]);
data(end+1) = footer;
end
%% FORMATTING ==================================================================
function str = integerToString(value)
% convert integer to string
str = sprintf('%d',value);
end
function str = markdownInlineCode(str)
% format as inline code for markdown
str = sprintf('`%s`', str);
end
function str = makeTable(data, fields, header)
% make a markdown table from struct array
nData = numel(data);
str = '';
if nData == 0
return; % empty input
end
%TODO: use gfmTable from makeTravisReport instead to do the formatting
% determine column sizes
nFields = numel(fields);
table = cell(nFields, nData);
columnWidth = zeros(1,nFields);
for iField = 1:nFields
field = fields{iField};
table(iField, :) = {data(:).(field)};
columnWidth(iField) = max(cellfun(@numel, table(iField, :)));
end
columnWidth = max(columnWidth, cellfun(@numel, header));
columnWidth = columnWidth + 2; % empty space left and right
columnWidth([1,end]) = columnWidth([1,end]) - 1; % except at the edges
% format table inside cell array
table = [header; table'];
for iField = 1:nFields
FORMAT = ['%' int2str(columnWidth(iField)) 's'];
for jData = 1:size(table, 1)
table{jData, iField} = strjust(sprintf(FORMAT, ...
table{jData, iField}), 'center');
end
end
% insert separator
table = [table(1,:)
arrayfun(@(n) repmat('-',1,n), columnWidth, 'UniformOutput',false)
table(2:end,:)]';
% convert cell array to string
FORMAT = ['%s' repmat('|%s', 1,nFields-1) '\n'];
str = sprintf(FORMAT, table{:});
end
function str = codelinks(str, functionName)
% replaces inline functions with clickable links in MATLAB
str = regexprep(str, '`([A-Za-z0-9_]+)`', ...
['`<a href="matlab:edit ' functionName '>$1">$1</a>`']);
%NOTE: editing function>subfunction will focus on that particular subfunction
% in the editor (this also works for the main function)
end
function str = bold(str)
str = ['**' str '**'];
end
%% PLOTTING ====================================================================
function h = statisticsPlot(stat, xLabel, yLabel)
% plot a histogram and box plot
nCategories = numel(stat.categories);
colors = colorscheme;
h(1) = subplot(5,1,1:4);
hold all;
hb = bar(stat.binCenter, stat.histogram, 'stacked');
for iCat = 1:nCategories
category = stat.categories{iCat};
set(hb(iCat), 'DisplayName', category, 'FaceColor', colors.(category), ...
'LineStyle','none');
end
%xlabel(xLabel);
ylabel(yLabel);
h(2) = subplot(5,1,5);
hold all;
boxplot(stat.values,'orientation','horizontal',...
'boxstyle', 'outline', ...
'symbol', 'o', ...
'colors', colors.All);
xlabel(xLabel);
xlims = [min(stat.binCenter)-1 max(stat.binCenter)+1];
c = 1;
ylims = (ylim(h(2)) - c)/3 + c;
set(h,'XTickMode','manual','XTick',stat.binCenter,'XLim',xlims);
set(h(1),'XTickLabel','');
set(h(2),'YTickLabel','','YLim',ylims);
linkaxes(h, 'x');
end
function colors = colorscheme()
% recognizable color scheme for the categories
colors.All = [ 0 113 188]/255;
colors.Good = [118 171 47]/255;
colors.Bad = [161 19 46]/255;
colors.Accepted = [236 176 31]/255;
end

256
01_tex/figures/00_matlab_fcn/matlab2tikz/test/compareTimings.m

@ -0,0 +1,256 @@ @@ -0,0 +1,256 @@
function compareTimings(statusBefore, statusAfter)
% COMPARETIMINGS compare timing of matlab2tikz test suite runs
%
% This function plots some analysis plots of the timings of different test
% cases. When the test suite is run repeatedly, the median statistics are
% reported as well as the individual runs.
%
% Usage:
% COMPARETIMINGS(statusBefore, statusAfter)
%
% Parameters:
% - statusBefore and statusAfter are expected to be
% N x R cell arrays, each cell contains a status of a test case
% where there are N test cases, repeated R times each.
%
% You can build such cells, e.g. with the following snippet.
%
% suite = @ACID
% N = numel(suite(0)); % number of test cases
% R = 10; % number of repetitions of each test case
%
% statusBefore = cell(N, R);
% for r = 1:R
% statusBefore(:, r) = testHeadless;
% end
%
% % now check out the after commit
%
% statusAfter = cell(N, R);
% for r = 1:R
% statusAfter(:, r) = testHeadless;
% end
%
% compareTimings(statusBefore, statusAfter)
%
% See also: testHeadless
%% Extract timing information
time_cf = extract(statusBefore, statusAfter, @(s) s.tikzStage.cleanfigure_time);
time_m2t = extract(statusBefore, statusAfter, @(s) s.tikzStage.m2t_time);
%% Construct plots
hax(1) = subplot(3,2,1);
histograms(time_cf, 'cleanfigure');
legend('show')
hax(2) = subplot(3,2,3);
histograms(time_m2t, 'matlab2tikz');
legend('show')
linkaxes(hax([1 2]),'x');
hax(3) = subplot(3,2,5);
histogramSpeedup('cleanfigure', time_cf, 'matlab2tikz', time_m2t);
legend('show');
hax(4) = subplot(3,2,2);
plotByTestCase(time_cf, 'cleanfigure');
legend('show')
hax(5) = subplot(3,2,4);
plotByTestCase(time_m2t, 'matlab2tikz');
legend('show')
hax(6) = subplot(3,2,6);
plotSpeedup('cleanfigure', time_cf, 'matlab2tikz', time_m2t);
legend('show');
linkaxes(hax([4 5 6]), 'x');
% ------------------------------------------------------------------------------
end
%% Data processing
function timing = extract(statusBefore, statusAfter, func)
otherwiseNaN = {'ErrorHandler', @(varargin) NaN};
timing.before = cellfun(func, statusBefore, otherwiseNaN{:});
timing.after = cellfun(func, statusAfter, otherwiseNaN{:});
end
function [names,timings] = splitNameTiming(vararginAsCell)
names = vararginAsCell(1:2:end-1);
timings = vararginAsCell(2:2:end);
end
%% Plot subfunctions
function [h] = histograms(timing, name)
% plot histogram of time measurements
colors = colorscheme;
histostyle = {'DisplayStyle', 'bar',...
'Normalization','pdf',...
'EdgeColor','none',...
'BinWidth',0.025};
hold on;
h{1} = myHistogram(timing.before, histostyle{:}, ...
'FaceColor', colors.before, ...
'DisplayName', 'Before');
h{2} = myHistogram(timing.after , histostyle{:}, ...
'FaceColor', colors.after,...
'DisplayName', 'After');
xlabel(sprintf('%s runtime [s]',name))
ylabel('Empirical PDF');
end
function [h] = histogramSpeedup(varargin)
% plot histogram of observed speedup
histostyle = {'DisplayStyle', 'bar',...
'Normalization','pdf',...
'EdgeColor','none'};
[names,timings] = splitNameTiming(varargin);
nData = numel(timings);
h = cell(nData, 1);
minTime = NaN; maxTime = NaN;
for iData = 1:nData
name = names{iData};
timing = timings{iData};
hold on;
speedup = computeSpeedup(timing);
color = colorOptionsOfName(name, 'FaceColor');
h{iData} = myHistogram(speedup, histostyle{:}, color{:},...
'DisplayName', name);
[minTime, maxTime] = minAndMax(speedup, minTime, maxTime);
end
xlabel('Speedup')
ylabel('Empirical PDF');
set(gca,'XScale','log', 'XLim', [minTime, maxTime].*[0.9 1.1]);
end
function [h] = plotByTestCase(timing, name)
% plot all time measurements per test case
colors = colorscheme;
hold on;
if size(timing.before, 2) > 1
h{3} = plot(timing.before, '.',...
'Color', colors.before, 'HandleVisibility', 'off');
h{4} = plot(timing.after, '.',...
'Color', colors.after, 'HandleVisibility', 'off');
end
h{1} = plot(median(timing.before, 2), '-',...
'LineWidth', 2, ...
'Color', colors.before, ...
'DisplayName', 'Before');
h{2} = plot(median(timing.after, 2), '-',...
'LineWidth', 2, ...
'Color', colors.after,...
'DisplayName', 'After');
ylabel(sprintf('%s runtime [s]', name));
set(gca,'YScale','log')
end
function [h] = plotSpeedup(varargin)
% plot speed up per test case
[names, timings] = splitNameTiming(varargin);
nDatasets = numel(names);
minTime = NaN;
maxTime = NaN;
h = cell(nDatasets, 1);
for iData = 1:nDatasets
name = names{iData};
timing = timings{iData};
color = colorOptionsOfName(name);
hold on
[speedup, medSpeedup] = computeSpeedup(timing);
if size(speedup, 2) > 1
plot(speedup, '.', color{:}, 'HandleVisibility','off');
end
h{iData} = plot(medSpeedup, color{:}, 'DisplayName', name, ...
'LineWidth', 2);
[minTime, maxTime] = minAndMax(speedup, minTime, maxTime);
end
nTests = size(speedup, 1);
plot([-nTests nTests*2], ones(2,1), 'k','HandleVisibility','off');
legend('show', 'Location','NorthWest')
set(gca,'YScale','log','YLim', [minTime, maxTime].*[0.9 1.1], ...
'XLim', [0 nTests+1])
xlabel('Test case');
ylabel('Speed-up (t_{before}/t_{after})');
end
%% Histogram wrapper
function [h] = myHistogram(data, varargin)
% this is a very crude wrapper that mimics Histogram in R2014a and older
if ~isempty(which('histogram'))
h = histogram(data, varargin{:});
else % no "histogram" available
options = struct(varargin{:});
minData = min(data(:));
maxData = max(data(:));
if isfield(options, 'BinWidth')
numBins = ceil((maxData-minData)/options.BinWidth);
elseif isfield(options, 'NumBins')
numBins = options.NumBins;
else
numBins = 10;
end
[counts, bins] = hist(data(:), numBins);
if isfield(options,'Normalization') && strcmp(options.Normalization,'pdf')
binWidth = mean(diff(bins));
counts = counts./sum(counts)/binWidth;
end
h = bar(bins, counts, 1);
% transfer properties as well
names = fieldnames(options);
for iName = 1:numel(names)
option = names{iName};
if isprop(h, option)
set(h, option, options.(option));
end
end
set(allchild(h),'FaceAlpha', 0.75); % only supported with OpenGL renderer
% but this should look a bit similar with matlab2tikz then...
end
end
%% Calculations
function [speedup, medSpeedup] = computeSpeedup(timing)
% computes the timing speedup (and median speedup)
dRep = 2; % dimension containing the repeated tests
speedup = timing.before ./ timing.after;
medSpeedup = median(timing.before, dRep) ./ median(timing.after, dRep);
end
function [minTime, maxTime] = minAndMax(speedup, minTime, maxTime)
% calculates the minimum/maximum time in an array and peviously
% computed min/max times
minTime = min([minTime; speedup(:)]);
maxTime = min([maxTime; speedup(:)]);
end
%% Color scheme
function colors = colorscheme()
% defines the color scheme
colors.matlab2tikz = [161 19 46]/255;
colors.cleanfigure = [ 0 113 188]/255;
colors.before = [236 176 31]/255;
colors.after = [118 171 47]/255;
end
function color = colorOptionsOfName(name, keyword)
% returns a cell array with a keyword (default: 'Color') and a named color
% if it exists in the colorscheme
if ~exist('keyword','var') || isempty(keyword)
keyword = 'Color';
end
colors = colorscheme;
if isfield(colors,name)
color = {keyword, colors.(name)};
else
color = {};
end
end

53
01_tex/figures/00_matlab_fcn/matlab2tikz/test/examples/example_bar_plot.m

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
function example_bar_plot()
test_data =[18 0; 20 0; 21 2; 30 14; 35 34; 40 57; 45 65; 50 46; 55 9; 60 2; 65 1; 70 0];
% Create figure
figure1 = figure('Color',[1 1 1]);
subplot(1,2,1)
hb=barh(test_data(:,1),test_data(:,2),'DisplayName','Test Data');
ylabel('parameter [units]');
xlabel('#');
legend('show','Location','northwest');
subplot(1,2,2)
hb=bar(test_data(:,1),test_data(:,2),'DisplayName','Test Data');
xlabel('parameter [units]');
ylabel('#');
legend('show','Location','northwest');
xdata=test_data(:,1);
barWidth=test_getBarWidthInAbsolutUnits(hb);
x_l=xdata-barWidth/2;
x_u=xdata+barWidth/2;
max_y=max(test_data(:,2))*1.2;
x=[];
y=[];
for i=1:length(x_l)
x = [x , x_l(i),x_l(i),nan,x_u(i),x_u(i),nan];
y = [y, 0,max_y ,nan,0 ,max_y ,nan];
end
hold on
plot(x,y,'r');
matlab2tikz('figurehandle',figure1,'filename','example_v_bar_plot.tex' ,'standalone', true);
function BarWidth=test_getBarWidthInAbsolutUnits(h)
% astimates the width of a bar plot
XData_bar=get(h,'XData');
length_bar = length(XData_bar);
BarWidth= get(h, 'BarWidth');
if length_bar > 1
BarWidth = min(diff(XData_bar))*BarWidth;
end

80
01_tex/figures/00_matlab_fcn/matlab2tikz/test/examples/example_quivers.m

@ -0,0 +1,80 @@ @@ -0,0 +1,80 @@
%% Quiver calculations
% These are calculations for the quiver dimensions as implemented in MATLAB
% (HG1) as in the |quiver.m| function.
%
% For HG2 and Octave, the situation might be different.
%
% A single quiver is defined as:
%
% C
% \
% \
% A ----------------- B
% /
% /
% D
%
% To know the dimensions of the arrow head, MATLAB defines the quantities
% alpha = beta = 0.33 that determine the coordinates of C and D as given below.
clc;
clear variables;
close all;
%% Parameters
try
syms x y z u v w alpha beta epsilon real
catch
warning('Symbolic toolbox not found. Interpret the values with care!');
x = randn(); y = randn(); z = randn();
u = randn(); v = randn(); w = randn();
end
alpha = 0.33;
beta = alpha;
epsilon = 0;
is2D = true;
%% Coordinates as defined in MATLAB
% Note that in 3D, the arrow head is oriented in a weird way. Let' just ignore
% that and only focus on 2D and use the same in 3D. Due to the lack
% of [u,v,w]-symmetry in those equations, the angle is bound to depend on the
% length of |delta|, i.e. something we don't know beforehand.
A = [x y z].';
delta = [u v w].';
B = A + delta;
C = B - alpha*[u+beta*(v+epsilon);
v-beta*(u+epsilon)
w];
D = B - alpha*[u-beta*(v+epsilon);
v+beta*(u+epsilon)
w];
if is2D
A = A(1:2);
B = B(1:2);
C = C(1:2);
D = D(1:2);
delta = delta(1:2);
end
%% Calculating the angle of the arrowhead
% Calculate the cos(angle) using the inner product
unitVector = @(v) v/norm(v);
cosAngleBetween = @(a,b,c) unitVector(a-b).' * unitVector(c-b);
cosTwiceTheta = cosAngleBetween(C,B,D);
if isa(cosTwiceTheta, 'sym')
cosTwiceTheta = simplify(cosTwiceTheta);
end
theta = acos(cosTwiceTheta) / 2
radToDeg = @(rads) (rads * 180 / pi);
thetaVal = radToDeg(theta)
try
thetaVal = double(thetaVal)
end
% For the MATLAB parameters alpha=beta=0.33, we get theta = 18.263 degrees.

222
01_tex/figures/00_matlab_fcn/matlab2tikz/test/makeLatexReport.m

@ -0,0 +1,222 @@ @@ -0,0 +1,222 @@
function makeLatexReport(status, output)
% generate a LaTeX report
%
%
if ~exist('output','var')
output = m2troot('test','output','current');
end
% first, initialize the tex output
SM = StreamMaker();
stream = SM.make(fullfile(output, 'acid.tex'), 'w');
texfile_init(stream);
printFigures(stream, status);
printSummaryTable(stream, status);
printErrorMessages(stream, status);
printEnvironmentInfo(stream, status);
texfile_finish(stream);
end
% =========================================================================
function texfile_init(stream)
stream.print(['\\documentclass[landscape]{scrartcl}\n' , ...
'\\pdfminorversion=6\n\n' , ...
'\\usepackage{amsmath} %% required for $\\text{xyz}$\n\n', ...
'\\usepackage{hyperref}\n' , ...
'\\usepackage{graphicx}\n' , ...
'\\usepackage{epstopdf}\n' , ...
'\\usepackage{tikz}\n' , ...
'\\usetikzlibrary{plotmarks}\n\n' , ...
'\\usepackage{pgfplots}\n' , ...
'\\pgfplotsset{compat=newest}\n\n' , ...
'\\usepackage[margin=0.5in]{geometry}\n' , ...
'\\newlength\\figurewidth\n' , ...
'\\setlength\\figurewidth{0.4\\textwidth}\n\n' , ...
'\\begin{document}\n\n']);
end
% =========================================================================
function texfile_finish(stream)
stream.print('\\end{document}');
end
% =========================================================================
function printFigures(stream, status)
for k = 1:length(status)
texfile_addtest(stream, status{k});
end
end
% =========================================================================
function printSummaryTable(stream, status)
texfile_tab_completion_init(stream)
for k = 1:length(status)
stat = status{k};
testNumber = stat.index;
% Break table up into pieces if it gets too long for one page
%TODO: use booktabs instead
%TODO: maybe just write a function to construct the table at once
% from a cell array (see makeTravisReport for GFM counterpart)
if ~mod(k,35)
texfile_tab_completion_finish(stream);
texfile_tab_completion_init(stream);
end
stream.print('%d & \\texttt{%s}', testNumber, name2tex(stat.function));
if stat.skip
stream.print(' & --- & skipped & ---');
else
for err = [stat.plotStage.error, ...
stat.saveStage.error, ...
stat.tikzStage.error]
if err
stream.print(' & \\textcolor{red}{failed}');
else
stream.print(' & \\textcolor{green!50!black}{passed}');
end
end
end
stream.print(' \\\\\n');
end
texfile_tab_completion_finish(stream);
end
% =========================================================================
function printErrorMessages(stream, status)
if errorHasOccurred(status)
stream.print('\\section*{Error messages}\n\\scriptsize\n');
for k = 1:length(status)
stat = status{k};
testNumber = stat.index;
if isempty(stat.plotStage.message) && ...
isempty(stat.saveStage.message) && ...
isempty(stat.tikzStage.message)
continue % No error messages for this test case
end
stream.print('\n\\subsection*{Test case %d: \\texttt{%s}}\n', testNumber, name2tex(stat.function));
print_verbatim_information(stream, 'Plot generation', stat.plotStage.message);
print_verbatim_information(stream, 'PDF generation' , stat.saveStage.message);
print_verbatim_information(stream, 'matlab2tikz' , stat.tikzStage.message);
end
stream.print('\n\\normalsize\n\n');
end
end
% =========================================================================
function printEnvironmentInfo(stream, status)
[env,versionString] = getEnvironment();
testsuites = unique(cellfun(@(s) func2str(s.testsuite) , status, ...
'UniformOutput', false));
testsuites = name2tex(m2tstrjoin(testsuites, ', '));
stream.print(['\\newpage\n',...
'\\begin{tabular}{ll}\n',...
' Suite & ' testsuites ' \\\\ \n', ...
' Created & ' datestr(now) ' \\\\ \n', ...
' OS & ' OSVersion ' \\\\ \n',...
' ' env ' & ' versionString ' \\\\ \n', ...
VersionControlIdentifier, ...
' TikZ & \\expandafter\\csname ver@tikz.sty\\endcsname \\\\ \n',...
' Pgfplots & \\expandafter\\csname ver@pgfplots.sty\\endcsname \\\\ \n',...
'\\end{tabular}\n']);
end
% =========================================================================
function print_verbatim_information(stream, title, contents)
if ~isempty(contents)
stream.print(['\\subsubsection*{%s}\n', ...
'\\begin{verbatim}\n%s\\end{verbatim}\n'], ...
title, contents);
end
end
% =========================================================================
function texfile_addtest(stream, status)
% Actually add the piece of LaTeX code that'll later be used to display
% the given test.
if ~status.skip
ref_error = status.plotStage.error;
gen_error = status.tikzStage.error;
ref_file = status.saveStage.texReference;
gen_file = status.tikzStage.pdfFile;
stream.print(...
['\\begin{figure}\n' , ...
' \\centering\n' , ...
' \\begin{tabular}{cc}\n' , ...
' %s & %s \\\\\n' , ...
' reference rendering & generated\n' , ...
' \\end{tabular}\n' , ...
' \\caption{%s \\texttt{%s}, \\texttt{%s(%d)}.%s}\n', ...
'\\end{figure}\n' , ...
'\\clearpage\n\n'],...
include_figure(ref_error, 'includegraphics', ref_file), ...
include_figure(gen_error, 'includegraphics', gen_file), ...
status.description, ...
name2tex(status.function), name2tex(status.testsuite), status.index, ...
formatIssuesForTeX(status.issues));
end
end
% =========================================================================
function str = include_figure(errorOccured, command, filename)
if errorOccured
str = sprintf(['\\tikz{\\draw[red,thick] ', ...
'(0,0) -- (\\figurewidth,\\figurewidth) ', ...
'(0,\\figurewidth) -- (\\figurewidth,0);}']);
else
switch command
case 'includegraphics'
strFormat = '\\includegraphics[width=\\figurewidth]{%s}';
case 'input'
strFormat = '\\input{%s}';
otherwise
error('Matlab2tikz_acidtest:UnknownFigureCommand', ...
'Unknown figure command "%s"', command);
end
str = sprintf(strFormat, filename);
end
end
% =========================================================================
function texfile_tab_completion_init(stream)
stream.print(['\\clearpage\n\n' , ...
'\\begin{table}\n' , ...
'\\centering\n' , ...
'\\caption{Test case completion summary}\n' , ...
'\\begin{tabular}{rlccc}\n' , ...
'No. & Test case & Plot & PDF & TikZ \\\\\n' , ...
'\\hline\n']);
end
% =========================================================================
function texfile_tab_completion_finish(stream)
stream.print( ['\\end{tabular}\n' , ...
'\\end{table}\n\n' ]);
end
% =========================================================================
function texName = name2tex(matlabIdentifier)
% convert a MATLAB identifier/function handle to a TeX string
if isa(matlabIdentifier, 'function_handle')
matlabIdentifier = func2str(matlabIdentifier);
end
texName = strrep(matlabIdentifier, '_', '\_');
end
% =========================================================================
function str = formatIssuesForTeX(issues)
% make links to GitHub issues for the LaTeX output
issues = issues(:)';
if isempty(issues)
str = '';
return
end
BASEURL = 'https://github.com/matlab2tikz/matlab2tikz/issues/';
SEPARATOR = sprintf(' \n');
strs = arrayfun(@(n) sprintf(['\\href{' BASEURL '%d}{\\#%d}'], n,n), issues, ...
'UniformOutput', false);
strs = [strs; repmat({SEPARATOR}, 1, numel(strs))];
str = sprintf('{\\color{blue} \\texttt{%s}}', [strs{:}]);
end
% ==============================================================================

74
01_tex/figures/00_matlab_fcn/matlab2tikz/test/makeTapReport.m

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
function makeTapReport(status, varargin)
% Makes a Test Anything Protocol report
%
% This function produces a testing report of HEADLESS tests for
% display on Jenkins (or any other TAP-compatible system)
%
% MAKETAPREPORT(status) produces the report from the `status` output of
% `testHeadless`.
%
% MAKETAPREPORT(status, 'stream', FID, ...) changes the filestream to use
% to output the report to. (Default: 1 (stdout)).
%
% TAP Specification: https://testanything.org
%
% See also: testHeadless, makeTravisReport, makeLatexReport
%% Parse input arguments
SM = StreamMaker();
ipp = m2tInputParser();
ipp = ipp.addRequired(ipp, 'status', @iscell);
ipp = ipp.addParamValue(ipp, 'stream', 1, SM.isStream);
ipp = ipp.parse(ipp, status, varargin{:});
arg = ipp.Results;
%% Construct stream
stream = SM.make(arg.stream, 'w');
%% build report
printTAPVersion(stream);
printTAPPlan(stream, status);
for iStatus = 1:numel(status)
printTAPReport(stream, status{iStatus}, iStatus);
end
end
% ==============================================================================
function printTAPVersion(stream)
% prints the TAP version
stream.print('TAP version 13\n');
end
function printTAPPlan(stream, statuses)
% prints the TAP test plan
firstTest = 1;
lastTest = numel(statuses);
stream.print('%d..%d\n', firstTest, lastTest);
end
function printTAPReport(stream, status, testNum)
% prints a TAP test case report
message = status.function;
if hasTestFailed(status)
result = 'not ok';
else
result = 'ok';
end
directives = getTAPDirectives(status);
stream.print('%s %d %s %s\n', result, testNum, message, directives);
%TODO: we can provide more information on the failure using YAML syntax
end
function directives = getTAPDirectives(status)
% add TAP directive (a todo or skip) to the test directives
directives = {};
if status.skip
directives{end+1} = '# SKIP skipped';
end
if status.unreliable
directives{end+1} = '# TODO unreliable';
end
directives = strtrim(m2tstrjoin(directives, ' '));
end
% ==============================================================================

360
01_tex/figures/00_matlab_fcn/matlab2tikz/test/makeTravisReport.m

@ -0,0 +1,360 @@ @@ -0,0 +1,360 @@
function [nErrors] = makeTravisReport(status, varargin)
% Makes a readable report for Travis/Github of test results
%
% This function produces a testing report of HEADLESS tests for
% display on GitHub and Travis.
%
% MAKETRAVISREPORT(status) produces the report from the `status` output of
% `testHeadless`.
%
% MAKETRAVISREPORT(status, 'stream', FID, ...) changes the filestream to use
% to output the report to. (Default: 1 (stdout)).
%
% MAKETRAVISREPORT(status, 'length', CHAR, ...) changes the report length.
% A few values are possible that cover different aspects in less/more detail.
% - 'default': all unreliable tests, failed & skipped tests and summary
% - 'short' : only show the brief summary
% - 'long' : all tests + summary
%
% See also: testHeadless, makeLatexReport
SM = StreamMaker();
%% Parse input arguments
ipp = m2tInputParser();
ipp = ipp.addRequired(ipp, 'status', @iscell);
ipp = ipp.addParamValue(ipp, 'stream', 1, SM.isStream);
ipp = ipp.addParamValue(ipp, 'length', 'default', @isReportLength);
ipp = ipp.parse(ipp, status, varargin{:});
arg = ipp.Results;
arg.length = lower(arg.length);
stream = SM.make(arg.stream, 'w');
%% transform status data into groups
S = splitStatuses(status);
%% build report
stream.print(gfmHeader(describeEnvironment));
reportUnreliableTests(stream, arg, S);
reportReliableTests(stream, arg, S);
displayTestSummary(stream, S);
%% set output arguments if needed
if nargout >= 1
nErrors = countNumberOfErrors(S.reliable);
end
end
% == INPUT VALIDATOR FUNCTIONS =================================================
function bool = isReportLength(val)
% validates the report length
bool = ismember(lower(val), {'default','short','long'});
end
% == GITHUB-FLAVORED MARKDOWN FUNCTIONS ========================================
function str = gfmTable(data, header, alignment)
% Construct a Github-flavored Markdown table
%
% Arguments:
% - data: nRows x nCols cell array that represents the data
% - header: cell array with the (nCol) column headers
% - alignment: alignment specification per column
% * 'l': left-aligned (default)
% * 'c': centered
% * 'r': right-aligned
% When not enough entries are specified, the specification is repeated
% cyclically.
%
% Output: table as a string
%
% See https://help.github.com/articles/github-flavored-markdown/#tables
% input argument validation and normalization
nCols = size(data, 2);
if ~exist('alignment','var') || isempty(alignment)
alignment = 'l';
end
if numel(alignment) < nCols
% repeat the alignment specifications along the columns
alignment = repmat(alignment, 1, nCols);
alignment = alignment(1:nCols);
end
% calculate the required column width
cellWidth = cellfun(@length, [header(:)' ;data]);
columnWidth = max(max(cellWidth, [], 1),3); % use at least 3 places
% prepare the table format
COLSEP = '|'; ROWSEP = sprintf('\n');
rowformat = [COLSEP sprintf([' %%%ds ' COLSEP], columnWidth) ROWSEP];
alignmentRow = formatAlignment(alignment, columnWidth);
% actually print the table
fullTable = [header; alignmentRow; data];
strs = cell(size(fullTable,1), 1);
for iRow = 1:numel(strs)
thisRow = fullTable(iRow,:);
%TODO: maybe preprocess thisRow with strjust first
strs{iRow} = sprintf(rowformat, thisRow{:});
end
str = [strs{:}];
%---------------------------------------------------------------------------
function alignRow = formatAlignment(alignment, columnWidth)
% Construct a row of dashes to specify the alignment of each column
% See https://help.github.com/articles/github-flavored-markdown/#tables
DASH = '-'; COLON = ':';
N = numel(columnWidth);
alignRow = arrayfun(@(w) repmat(DASH, 1, w), columnWidth, ...
'UniformOutput', false);
for iColumn = 1:N
thisAlign = alignment(iColumn);
thisSpec = alignRow{iColumn};
switch lower(thisAlign)
case 'l'
thisSpec(1) = COLON;
case 'r'
thisSpec(end) = COLON;
case 'c'
thisSpec([1 end]) = COLON;
otherwise
error('gfmTable:BadAlignment','Unknown alignment "%s"',...
thisAlign);
end
alignRow{iColumn} = thisSpec;
end
end
end
function str = gfmCode(str, inline, language)
% Construct a GFM code fragment
%
% Arguments:
% - str: code to be displayed
% - inline: - true -> formats inline
% - false -> formats as code block
% - [] -> automatic mode (default): picks one of the above
% - language: which language the code is (enforces a code block)
%
% Output: GFM formatted string
%
% See https://help.github.com/articles/github-flavored-markdown
if ~exist('inline','var')
inline = [];
end
if ~exist('language','var') || isempty(language)
language = '';
else
inline = false; % highlighting is not supported for inline code
end
if isempty(inline)
inline = isempty(strfind(str, sprintf('\n')));
end
if inline
prefix = '`';
postfix = '`';
else
prefix = sprintf('\n```%s\n', language);
postfix = sprintf('\n```\n');
if str(end) == sprintf('\n')
postfix = postfix(2:end); % remove extra endline
end
end
str = sprintf('%s%s%s', prefix, str, postfix);
end
function str = gfmHeader(str, level)
% Constructs a GFM/Markdown header
if ~exist('level','var')
level = 1;
end
str = sprintf('\n%s %s\n', repmat('#', 1, level), str);
end
function symbols = githubEmoji()
% defines the emojis to signal the test result
symbols = struct('pass', ':white_check_mark:', ...
'fail', ':heavy_exclamation_mark:', ...
'skip', ':grey_question:');
end
% ==============================================================================
function S = splitStatuses(status)
% splits a cell array of statuses into a struct of cell arrays
% of statuses according to their value of "skip", "reliable" and whether
% an error has occured.
% See also: splitUnreliableTests, splitPassFailSkippedTests
S = struct('all', {status}); % beware of cell array assignment to structs!
[S.reliable, S.unreliable] = splitUnreliableTests(status);
[S.passR, S.failR, S.skipR] = splitPassFailSkippedTests(S.reliable);
[S.passU, S.failU, S.skipU] = splitPassFailSkippedTests(S.unreliable);
end
% ==============================================================================
function [short, long] = describeEnvironment()
% describes the environment in a short and long format
[env, ver] = getEnvironment;
[dummy, VCID] = VersionControlIdentifier(); %#ok
if ~isempty(VCID)
VCID = [' commit ' VCID(1:10)];
end
OS = OSVersion;
short = sprintf('%s %s (%s)', env, ver, OS, VCID);
long = sprintf('Test results for m2t%s running with %s %s on %s.', ...
VCID, env, ver, OS);
end
% ==============================================================================
function reportUnreliableTests(stream, arg, S)
% report on the unreliable tests
if ~isempty(S.unreliable) && ~strcmpi(arg.length, 'short')
stream.print(gfmHeader('Unreliable tests',2));
stream.print('These do not cause the build to fail.\n\n');
displayTestResults(stream, S.unreliable);
end
end
function reportReliableTests(stream, arg, S)
% report on the reliable tests
switch arg.length
case 'long'
tests = S.reliable;
message = '';
case 'default'
tests = [S.failR; S.skipR];
message = 'Passing tests are not shown (only failed and skipped tests).\n\n';
case 'short'
return; % don't show this part
end
stream.print(gfmHeader('Reliable tests',2));
stream.print('Only the reliable tests determine the build outcome.\n');
stream.print(message);
displayTestResults(stream, tests);
end
% ==============================================================================
function displayTestResults(stream, status)
% display a table of specific test outcomes
headers = {'Testcase', 'Name', 'OK', 'Status'};
data = cell(numel(status), numel(headers));
symbols = githubEmoji;
for iTest = 1:numel(status)
data(iTest,:) = fillTestResultRow(status{iTest}, symbols);
end
str = gfmTable(data, headers, 'llcl');
stream.print('%s', str);
end
function row = fillTestResultRow(oneStatus, symbol)
% format the status of a single test for the summary table
testNumber = oneStatus.index;
testSuite = func2str(oneStatus.testsuite);
summary = '';
if oneStatus.skip
summary = 'SKIPPED';
passOrFail = symbol.skip;
else
stages = getStagesFromStatus(oneStatus);
for jStage = 1:numel(stages)
thisStage = oneStatus.(stages{jStage});
if ~thisStage.error
continue;
end
stageName = strrep(stages{jStage},'Stage','');
switch stageName
case 'plot'
summary = sprintf('%s plot failed', summary);
case 'tikz'
summary = sprintf('%s m2t failed', summary);
case 'hash'
summary = sprintf('new hash %32s != expected (%32s) %s', ...
thisStage.found, thisStage.expected, summary);
otherwise
summary = sprintf('%s %s FAILED', summary, thisStage);
end
end
if isempty(summary)
passOrFail = symbol.pass;
else
passOrFail = symbol.fail;
end
summary = strtrim(summary);
end
row = { gfmCode(sprintf('%s(%d)', testSuite, testNumber)), ...
gfmCode(oneStatus.function), ...
passOrFail, ...
summary};
end
% ==============================================================================
function displayTestSummary(stream, S)
% display a table of # of failed/passed/skipped tests vs (un)reliable
% compute number of cases per category
reliableSummary = cellfun(@numel, {S.passR, S.failR, S.skipR});
unreliableSummary = cellfun(@numel, {S.passU, S.failU, S.skipU});
% make summary table + calculate totals
summary = [unreliableSummary numel(S.unreliable);
reliableSummary numel(S.reliable);
reliableSummary+unreliableSummary numel(S.all)];
% put results into cell array with proper layout
summary = arrayfun(@(v) sprintf('%d',v), summary, 'UniformOutput', false);
table = repmat({''}, 3, 5);
header = {'','Pass','Fail','Skip','Total'};
table(:,1) = {'Unreliable','Reliable','Total'};
table(:,2:end) = summary;
% print table
[envShort, envDescription] = describeEnvironment(); %#ok
stream.print(gfmHeader('Test summary', 2));
stream.print('%s\n', envDescription);
stream.print('%s\n', gfmCode(generateCode(S),false,'matlab'));
stream.print(gfmTable(table, header, 'lrrrr'));
% print overall outcome
symbol = githubEmoji;
nErrors = numel(S.failR);
if nErrors == 0
stream.print('\nBuild passes. %s\n', symbol.pass);
else
stream.print('\nBuild fails with %d errors. %s\n', nErrors, symbol.fail);
end
end
function code = generateCode(S)
% generates some MATLAB code to easily replicate the results
code = sprintf('%s = %s;\n', ...
'suite', ['@' func2str(S.all{1}.testsuite)], ...
'alltests', testNumbers(S.all), ...
'reliable', testNumbers(S.reliable), ...
'unreliable', testNumbers(S.unreliable), ...
'failReliable', testNumbers(S.failR), ...
'passUnreliable', testNumbers(S.passU), ...
'skipped', testNumbers([S.skipR; S.skipU]));
% --------------------------------------------------------------------------
function str = testNumbers(status)
str = intelligentVector( cellfun(@(s) s.index, status) );
end
end
function str = intelligentVector(numbers)
% Produce a string that is an intelligent vector notation of its arguments
% e.g. when numbers = [ 1 2 3 4 6 7 8 9 ], it should return '[ 1:4 6:9 ]'
% The order in the vector is not retained!
if isempty(numbers)
str = '[]';
else
numbers = sort(numbers(:).');
delta = diff([numbers(1)-1 numbers]);
% place virtual bounds at the first element and beyond the last one
bounds = [1 find(delta~=1) numel(numbers)+1];
idx = 1:(numel(bounds)-1); % start index of each segment
start = numbers(bounds(idx ) );
stop = numbers(bounds(idx+1)-1);
parts = arrayfun(@formatRange, start, stop, 'UniformOutput', false);
str = sprintf('[%s]', strtrim(sprintf('%s ', parts{:})));
end
end
function str = formatRange(start, stop)
% format a range [start:stop] of integers in MATLAB syntax
if start==stop
str = sprintf('%d',start);
else
str = sprintf('%d:%d',start, stop);
end
end
% ==============================================================================

4
01_tex/figures/00_matlab_fcn/matlab2tikz/test/output/.gitignore vendored

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
# This is a directory for testing output. Nothing in here should ever
# be committed, except the .gitignore to enforce all of this.
*
!.gitignore

36
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/OSVersion.m

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
function [formatted, OSType, OSVersion] = OSVersion()
% determines the OS type and its (kernel) version number
if ismac
OSType = 'Mac OS';
[dummy, OSVersion] = system('sw_vers -productVersion'); %#ok
% Output like "10.10.4" for OS X Yosemite
elseif ispc
OSType = 'Windows';
[dummy, rawVersion] = system('ver'); %#ok
% Output like "Microsoft Windows [Version 6.3.9600]" for Win8.1
pattern = '(?<=Version )[0-9.]+';
OSVersion = regexpi(rawVersion, pattern, 'match', 'once');
elseif isunix
[dummy, OSType] = system('uname -s'); %#ok
% This returns the kernal name
% e.g. "Linux" on Linux, "Darwin" on Mac, "SunOS" on Solaris
[dummy, OSVersion] = system('uname -r'); %#ok
% Returns the kernel version. Many Linux distributions
% include an identifier, e.g. "4.0.7-2-ARCH" on Arch Linux
% TODO: also use `lsb_release` in Linux for distro info
else
warning('OSVersion:UnknownOS', 'Could not recognize OS.');
OSType = 'Unknown OS';
OSVersion = '';
end
EOL = sprintf('\n');
OSType = strrep(OSType, EOL, '');
OSVersion = strrep(OSVersion, EOL, '');
formatted = strtrim([OSType ' ' OSVersion]);
end

74
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/StreamMaker.m

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
function SM = StreamMaker()
% StreamMaker (Factory for fie/input/output Streams)
%
% A StreamMaker can make Stream PseudoObjects based on either
% an "fid" or "filename" (and extra arguments for `fopen`).
% The StreamMaker also contains a method `isStream` to validate whether
% the value passed is a valid stream specifier.
%
% Usage
%
% SM = StreamMaker;
%
% Stream = SM.make(fid)
% Stream = SM.make(filename, ...)
%
% This returns a PseudoObject Stream with the following properties:
% - name: (file) name of the stream
% - fid: handle (fid) of the stream
%
% and methods:
% - print: prints to the stream, i.e. fprintf
% - close: closes the stream, i.e. fclose
%
% It may also contain a field to automatically close the Stream when it goes
% out of scope.
%
SM = PseudoObject('StreamMaker', ...
'isStream', @isStream, ...
'make', @constructStream);
end
function PseudoObj = PseudoObject(T, varargin)
% construct a Pseudo-Object with type T (no other fields yet)
PseudoObj = struct('Type', T, varargin{:});
end
function bool = isStream(value)
bool = ischar(value) || ismember(value, [1,2,fopen('all')]);
%TODO: allow others kinds of streams
% Stream -> clipboard (write on close)
% Stream -> string variable
% e.g. a quick-and-dirty way would be to write the file to `tempname`
% putting a flag to read that file back upon completion.
end
function Stream = constructStream(streamSpecifier, varargin)
% this is the actual constructor of a stream
if ~isStream(streamSpecifier)
error('StreamMaker:NotAStream', 'Invalid stream specifier "%s"', ...
streamSpecifier);
end
Stream = PseudoObject('Stream');
closeAfterUse = false;
if ischar(streamSpecifier)
Stream.name = streamSpecifier;
Stream.fid = fopen(Stream.name, varargin{:});
closeAfterUse = true;
elseif isnumeric(streamSpecifier)
Stream.fid = streamSpecifier;
Stream.name = fopen(Stream.fid);
end
if Stream.fid == -1
error('Stream:InvalidStream', ...
'Unable to create stream "%s"!', streamSpecifier);
end
Stream.print = @(varargin) fprintf(Stream.fid, varargin{:});
Stream.close = @() fclose(Stream.fid);
if closeAfterUse
Stream.closeAfterUse = onCleanup(Stream.close);
end
end

47
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/VersionControlIdentifier.m

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
function [formatted,treeish] = VersionControlIdentifier()
% This function gives the (git) commit ID of matlab2tikz
%
% This assumes the standard directory structure as used by Nico's master branch:
% SOMEPATH/src/matlab2tikz.m with a .git directory in SOMEPATH.
%
% The HEAD of that repository is determined from file system information only
% by following dynamic references (e.g. ref:refs/heds/master) in branch files
% until an absolute commit hash (e.g. 1a3c9d1...) is found.
% NOTE: Packed branch references are NOT supported by this approach
MAXITER = 10; % stop following dynamic references after a while
formatted = '';
REFPREFIX = 'ref:';
isReference = @(treeish)(any(strfind(treeish, REFPREFIX)));
treeish = [REFPREFIX 'HEAD'];
try
% get the matlab2tikz directory
privateDir = fileparts(mfilename('fullpath'));
gitDir = fullfile(privateDir,'..','..','.git');
nIter = 1;
while isReference(treeish)
refName = treeish(numel(REFPREFIX)+1:end);
branchFile = fullfile(gitDir, refName);
if exist(branchFile, 'file') && nIter < MAXITER
% The FID is reused in every iteration, so `onCleanup` cannot
% be used to `fclose(fid)`. But since there is very little that
% can go wrong in a single `fscanf`, it's probably best to leave
% this part as it is for the time being.
fid = fopen(branchFile,'r');
treeish = fscanf(fid,'%s');
fclose(fid);
nIter = nIter + 1;
else % no branch file or iteration limit reached
treeish = '';
return;
end
end
catch %#ok
treeish = '';
end
if ~isempty(treeish)
formatted = [' Commit & ' treeish ' \\\\ \n'];
end
%TODO: do the formatting somewhere else!
end

35
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/calculateMD5Hash.m

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
function hash = calculateMD5Hash(filename)
% CALCULATEMD5HASH calculate a MD5 hash of a file
%
% This functionality is built-in into Octave but uses Java in MATLAB.
switch getEnvironment
case 'Octave'
hash = md5sum(filename);
case 'MATLAB'
% There are some MD5 implementations in MATLAB, but those
% tend to be slow and licensing is unclear.
% Rolling our own implementation is unwanted, especially since this
% is a cryptographic hash, even though its security has been
% broken. Instead we make use of the Java libraries.
% Unless the "-nojvm" flag is specified, this should work well.
MD5 = java.security.MessageDigest.getInstance('MD5');
% Open the file
fid = fopen(filename, 'r');
% Make sure fid is closed
finally_close = onCleanup(@()fclose(fid));
% Faster file digest based on code by Jan Simon as in
% http://www.mathworks.com/matlabcentral/fileexchange/31272-datahash
data = fread(fid, '*uint8');
MD5.update(data);
hash = reshape(dec2hex(typecast(MD5.digest(),'uint8')).', 1, 32);
end
hash = lower(hash);
end

19
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/cleanFiles.m

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
function cleanFiles(cleanBefore)
% clean output files in ./tex using make
%FIXME: this file appears to be unused (but it is useful)
%FIXME: adapt this file to take the output directory into account
if cleanBefore && exist(fullfile('tex','Makefile'),'file')
fprintf(1, 'Cleaning output files...\n');
cwd = pwd;
try
cd('tex');
[exitCode, output] = system('make distclean');
fprintf(1,'%s\n', output);
assert(exitCode==0, 'Exit code 0 means correct execution');
catch
% This might happen when make is not present
fprintf(2, '\tNot completed succesfully\n\n');
end
cd(cwd);
end
end

4
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/countNumberOfErrors.m

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
function nErrors = countNumberOfErrors(status)
% counts the number of errors in a status cell array
nErrors = sum(hasTestFailed(status));
end

4
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/emptyStage.m

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
function stage = emptyStage()
% constructs an empty (workflow) stage struct
stage = struct('message', '', 'error' , false);
end

24
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/emptyStatus.m

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
function defaultStatus = emptyStatus(testsuite, testNumber)
% constructs an empty status struct
defaultStatus = struct(...
'function', '', ...
'description', '',...
'testsuite', testsuite ,...
'index', testNumber, ...
'issues', [],...
'unreliable', false, ...
'skip', false, ... % skipped this test?
'closeall', false, ... % call close all after?
'extraOptions', {cell(0)}, ...
'extraCleanfigureOptions',{cell(0)}, ...
'plotStage', emptyStage(), ...
'saveStage', emptyStage(), ...
'tikzStage', emptyStage(), ...
'hashStage', emptyStage() ...
);
% for reliable tests explicitly define width and height, see #659
% TODO: Remove explicitly setting this option.
% After #641 is merged, this might be not needed anyhow.
defaultStatus.extraCleanfigureOptions = {'targetResolution', [1000,500]};
end

41
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/errorHandler.m

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
function [stage, errorHasOccurred] = errorHandler(e)
% common error handler code: save and print to console
errorHasOccurred = true;
stage = emptyStage();
stage.message = format_error_message(e);
stage.error = errorHasOccurred;
disp_error_message(stage.message);
end
% ==============================================================================
function msg = format_error_message(e)
msg = '';
if ~isempty(e.message)
msg = sprintf('%serror: %s\n', msg, e.message);
end
if ~isempty(e.identifier)
if strfind(lower(e.identifier),'testmatlab2tikz:')
% When "errors" occur in the test framework, i.e. a hash mismatch
% or no hash provided, there is no need to be very verbose.
% So we don't return the msgid and the stack trace in those cases!
return % only return the message
end
msg = sprintf('%serror: %s\n', msg, e.identifier);
end
if ~isempty(e.stack)
msg = sprintf('%serror: called from:\n', msg);
for ee = e.stack(:)'
msg = sprintf('%serror: %s at line %d, in function %s\n', ...
msg, ee.file, ee.line, ee.name);
end
end
end
% ==============================================================================
function disp_error_message(msg)
stderr = 2;
% The error message should not contain any more escape sequences and
% hence can be output literally to stderr.
fprintf(stderr, '%s', msg);
end
% ==============================================================================

16
01_tex/figures/00_matlab_fcn/matlab2tikz/test/private/errorHasOccurred.m

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
function errorOccurred = errorHasOccurred(status)
% determines whether an error has occurred from a status struct OR cell array
% of status structs
errorOccurred = false;
if iscell(status)
for iStatus = 1:numel(status)
errorOccurred = errorOccurred || errorHasOccurred(status{iStatus});
end
else
stages = getStagesFromStatus(status);
for iStage = 1:numel(stages)
thisStage = status.(stages{iStage});
errorOccurred = errorOccurred || thisStage.error;
end
end
end

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save