diff --git a/texnotes/num2Notes.pdf b/texnotes/num2Notes.pdf index 095df92..2132ad8 100644 Binary files a/texnotes/num2Notes.pdf and b/texnotes/num2Notes.pdf differ diff --git a/texnotes/num2Notes.tex b/texnotes/num2Notes.tex index 0bec2c9..74874b7 100644 --- a/texnotes/num2Notes.tex +++ b/texnotes/num2Notes.tex @@ -129,9 +129,7 @@ \begin{document} \pagestyle{fancy} -% \include{ue1} -% \include{ue2} - \include{ue3} + \input{spicker01} \end{document} diff --git a/texnotes/num2Spicker.pdf b/texnotes/num2Spicker.pdf new file mode 100644 index 0000000..d561ae2 Binary files /dev/null and b/texnotes/num2Spicker.pdf differ diff --git a/texnotes/num2Spicker.tex b/texnotes/num2Spicker.tex new file mode 100644 index 0000000..334bb52 --- /dev/null +++ b/texnotes/num2Spicker.tex @@ -0,0 +1,193 @@ +\documentclass[12pt]{article} + +\usepackage{amsmath,amssymb, a4, verbatim} +\usepackage[german]{babel} +%\usepackage[latin1]{inputenc} +\usepackage[utf8]{inputenc} % üöäß +\usepackage{listings} % für inline codelistings +\lstset{% + basicstyle=\ttfamily, % the size of the fonts + columns=fixed, % anything else is horrifying + showspaces=false, % show spaces using underscores? + showstringspaces=false, % underline spaces within strings? + showtabs=false, % show tabs within strings? + xleftmargin=1.5em, % left margin space +} +\lstdefinestyle{inline}{basicstyle=\ttfamily} +\newcommand{\listline}[1]{\lstinline[style=inline]!#1!} + + +\usepackage{caption} +\newcommand{\tinycaption}[1]{\captionsetup{labelformat=empty}\caption{#1}} + +%\usepackage{color} +%\usepackage{epsfig} % eps +\usepackage{graphicx} % eps +%\usepackage[shortcuts]{extdash} +%\usepackage{dsfont} +%\usepackage{epstopdf} % eps +%\usepackage[pdf]{pstricks} % eps +%\usepackage{auto-pst-pdf} +\usepackage{mathtools} +\usepackage{dsfont} % $ \mathds{1} $ +%\usepackage{icomma} +\usepackage{tikz} +%\usepackage{pgfplots} +%\pgfplotsset{compat=1.8} +\usepackage[bottom]{footmisc} % put footnotes at the bottom of page +\usepackage{nicefrac} % für brüche die aussehen wie prozentzeichen +% \usepackage{ps2pdf} +\usetikzlibrary{automata,positioning} + +\usepackage{algorithmicx} +\usepackage{algpseudocode} +\usepackage{algorithm} + +\usepackage{multicol} +\usepackage{wrapfig} % make stuff float +\usepackage{placeins} % stop stuff from floating +\usepackage{seqsplit} % very long numbers +\usepackage{framed} % begin{framed} + +% Headings and Footings : +%\usepackage{fancyhdr} +%\headheight15pt +%\lhead{Numerik II, \ueberschrift} + +%\chead{} +%\rhead{\thepage} +%\renewcommand{\headrulewidth}{.4pt} + +%\lfoot{\today} +%\cfoot{} +%\rfoot{Joshua} +%\renewcommand{\footrulewidth}{.4pt} + +%---------------------------------------------------------------- + +%\textwidth16.5cm +%\oddsidemargin0.cm +%\evensidemargin0.cm + +\def\somedistanceLeft{10mm}%2cm} +\def\somedistanceTop{10mm}%3cm} + +\usepackage{geometry} +\geometry{ + a4paper, % or A3, etc if to print smaller +% total={170mm,257mm}, + left=\somedistanceLeft, + right=\somedistanceLeft, + top=\somedistanceTop, + bottom=\somedistanceTop, + landscape % better i think +} + + +\parindent0cm + +\usepackage{cancel} + +\newcommand{\R}{ {\mathbb R} } +\newcommand{\C}{ {\mathbb C} } +\newcommand{\1}{ {\mathds{1}} } +\newcommand{\abs}[1]{\lvert#1\rvert} +\newcommand{\norm}[1]{\left\lVert#1\right\rVert} +\newcommand{\xt}{\tilde{x}} +\newcommand{\dotleq}{\dot{\leq}} +\newcommand{\m}{\hphantom{-} } + +\newcommand{\dashfill}[1]{\vspace{11pt}\def\dashfill{\cleaders\hbox{#1}\hfill}\hbox to \hsize{\dashfill\hfil}\vspace{11pt}} +\newcommand{\scdot}{\!\cdot\!} + + +\newcommand{\sig}{\text{signum}} +\newcommand{\rot}{} + +% ------------------ edit Ueberschrift --------------------- +\newcommand{\ueberschrift}{Numerik II Notizen} + + +\usepackage{mathpazo} +\usepackage[mathpazo]{flexisym} +\usepackage{breqn} + +% https://tex.stackexchange.com/questions/110393/too-wide-figure-caption +% ffs \usepackage{boxhandler} + +\newcommand{\scalprod}[2]{\left\langle\,#1\,;\,#2\,\right\rangle} + +\usepackage{url} + +\usepackage{pdfpages} +%\usepackage{showframe} +% ----------------------------------------------------------- + + +%\texttt{} num.num.alph as headings +\renewcommand{\thesubsubsection}{\thesubsection.\alph{subsubsection}} + +\begin{document} + \pagestyle{empty} % no line numbers + + % equation spacing + \def\distEQ{12pt} + \abovedisplayskip=\distEQ plus 0pt minus \distEQ + \abovedisplayshortskip=0pt plus 0pt + \belowdisplayskip=\distEQ plus 0pt minus \distEQ + \belowdisplayshortskip=7pt plus 0pt minus 7pt + + % line between collumns + \setlength{\columnsep}{5mm} + \setlength{\columnseprule}{1pt} + \begin{multicols}{2} + \input{spicker01} + \end{multicols} + +\end{document} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/texnotes/spicker01.tex b/texnotes/spicker01.tex new file mode 100644 index 0000000..452408b --- /dev/null +++ b/texnotes/spicker01.tex @@ -0,0 +1,20 @@ +\begin{minipage}[tc]{\linewidth} + Lineares Ausgleichsproblem: + \begin{tabular}{cl} + \begin{tabular}{r|c|c|c|c} + $t_i$ & 0 & 1 & 2 & 3 \\ + \hline + $y_i$ & 3 & $2,14$ & 1,8 & 1,72 \\ + \end{tabular} & Daten \\ + func & Modellfunktion \\ + \end{tabular} +\end{minipage} + +\begin{minipage}[tc]{\linewidth} + Satz: 1.1: \linebreak[3] + $x^*\in \R$ ist genau dann eine Lösung des linearen Ausgleichsproblems, + wenn $x^*$ Lösung der Normalgleichung $A^TAx = A^Tb$ ist. + Es gibt mindestens eine Lösung $x^*$. + Sie ist eindeutig, gdw. $Rang(A) = n$. +\end{minipage} + diff --git a/uebungen/.gitignore b/uebungen/.gitignore new file mode 100644 index 0000000..21229f7 --- /dev/null +++ b/uebungen/.gitignore @@ -0,0 +1 @@ +*.asv \ No newline at end of file diff --git a/uebungen/Num2_Probeaufgaben.pdf b/uebungen/Num2_Probeaufgaben.pdf new file mode 100644 index 0000000..ae7fb83 Binary files /dev/null and b/uebungen/Num2_Probeaufgaben.pdf differ diff --git a/uebungen/Num2_Projekt_1.pdf b/uebungen/Num2_Projekt_1.pdf new file mode 100644 index 0000000..50d8fe4 Binary files /dev/null and b/uebungen/Num2_Projekt_1.pdf differ diff --git a/uebungen/Num2_Projekt_2.pdf b/uebungen/Num2_Projekt_2.pdf new file mode 100644 index 0000000..4dea5ba Binary files /dev/null and b/uebungen/Num2_Projekt_2.pdf differ diff --git a/uebungen/Num2_uebung2.pdf b/uebungen/Num2_uebung2.pdf index 24f6b58..f74f3dc 100644 Binary files a/uebungen/Num2_uebung2.pdf and b/uebungen/Num2_uebung2.pdf differ diff --git a/uebungen/Num2_uebung5_Loesungen.pdf b/uebungen/Num2_uebung5_Loesungen.pdf new file mode 100644 index 0000000..e1da53e Binary files /dev/null and b/uebungen/Num2_uebung5_Loesungen.pdf differ diff --git a/uebungen/factorio/funcApprox/logbApprox.m b/uebungen/factorio/funcApprox/logbApprox.m index 073fb17..5ffc1b9 100644 --- a/uebungen/factorio/funcApprox/logbApprox.m +++ b/uebungen/factorio/funcApprox/logbApprox.m @@ -8,6 +8,11 @@ limit_end = 3e5; base = (limit_end)^(1/100); % of the log, meaning logb(limit_end) := 100 logb = @(x) log(x)/log(base); +%ableitung +logbA1 = @(x) 1 ./ (x .* log(base)); +logbA2 = @(x) - 1 ./ (x .^ 2 .* log(base)); +logbA3 = @(x) 2 ./ (x .^ 3 .* log(base)); + n = 10; % amount of nodes diff --git a/uebungen/lagrangePolynom.m b/uebungen/lagrangePolynom.m new file mode 100644 index 0000000..49d7802 --- /dev/null +++ b/uebungen/lagrangePolynom.m @@ -0,0 +1,8 @@ +function [ y ] = lagrangePolynom( j, knoten, x ) + y = ones(size(x)); + for i = 1:length(knoten) + if j == i ; continue; end; + y = y .* (x-knoten(i)) ./ (knoten(j)-knoten(i)); + end +end % function + diff --git a/uebungen/ue5_3.m b/uebungen/ue5_3.m new file mode 100644 index 0000000..ca7c94c --- /dev/null +++ b/uebungen/ue5_3.m @@ -0,0 +1,57 @@ +format compact; +format shortg; +clear all; +close all; + +n = 6; +nPoints = n*100; +more = 0.02*0; +x = linspace(-1-more,1+more,nPoints); + +funToInterp = @(t) sin(t*pi); + + +%% lagrange +subplot(2,1,1); +hold on; + +xiEqual = -1 +2* (0:n) ./ n + +plot(xiEqual, 1, 'o', 'HandleVisibility','off'); +allY = zeros(size(x)); +for j=(0:n)+1 + y = lagrangePolynom(j, xiEqual, x); + allY = allY + y*funToInterp(xiEqual(j)); + plot(x,y, 'HandleVisibility','off'); + axis tight; +end +plot(x, allY, '-g.', 'DisplayName', 'Approximation'); +err = abs(funToInterp(x)-allY); +max(err) +plot(x, err, '-r.', 'DisplayName', 'Error'); +plot(x, funToInterp(x), '-b', 'DisplayName', 'funToInterp'); +legend show; + +%% tschebyschow +subplot(2,1,2); +hold on; + +xiTsche = -cos((2*(0:n)+1) / (2*n + 2) * pi); + +plot(xiTsche, 1, 'o', 'HandleVisibility','off'); +allY = zeros(size(x)); +for j=(0:n)+1 + y = lagrangePolynom(j, xiTsche, x); + allY = allY + y*funToInterp(xiTsche(j)); + plot(x,y, 'HandleVisibility','off'); + axis tight; +end +plot(x, allY, '-g.', 'DisplayName', 'Approximation'); +err = abs(funToInterp(x)-allY); +max(err) +plot(x, err, '-r.', 'DisplayName', 'Error'); +plot(x, funToInterp(x), '-b', 'DisplayName', 'funToInterp'); + +legend show; + +