fix error in polygonzugverfahren image, add tikz math library to lecture cls
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
\documentclass{lecture}
|
\documentclass{lecture}
|
||||||
|
|
||||||
|
\usetikzlibrary{math}
|
||||||
\begin{document}
|
\begin{document}
|
||||||
\newcommand{\dv}[2]{\frac{\mathrm{d} #1}{\mathrm{d} #2}}
|
\newcommand{\dv}[2]{\frac{\mathrm{d} #1}{\mathrm{d} #2}}
|
||||||
\newcommand{\graph}{\operatorname{Graph}}
|
\newcommand{\graph}{\operatorname{Graph}}
|
||||||
@@ -119,7 +120,7 @@ Notationen: $x' = f(t,x), \dot x = f(t,x), \dv{x}{t} = f(t,x)$ (Dynamischer Proz
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
\addplot3 (x,y,0);
|
\addplot3 (x,y,0);
|
||||||
\addlegendentry{$f'(t,x)$}
|
\addlegendentry{$f(t,x)$}
|
||||||
\addplot{(x-0.25)^2+0.15};
|
\addplot{(x-0.25)^2+0.15};
|
||||||
\addlegendentry{$y(t)$}
|
\addlegendentry{$y(t)$}
|
||||||
\end{axis}
|
\end{axis}
|
||||||
@@ -236,45 +237,63 @@ Reminder:
|
|||||||
\[y^h(t)\coloneqq y_{n-1}^h + (t-t_{n-1})f(t_{n-1},y_{n-1}^h),\quad t\in [t_{n-1},t_n],\quad \forall n\ge 1\]
|
\[y^h(t)\coloneqq y_{n-1}^h + (t-t_{n-1})f(t_{n-1},y_{n-1}^h),\quad t\in [t_{n-1},t_n],\quad \forall n\ge 1\]
|
||||||
\begin{figure}[h]
|
\begin{figure}[h]
|
||||||
\centering
|
\centering
|
||||||
\begin{tikzpicture}[declare function={f1(\x) = 0.5*(2)^(\x-1) + 10/(\x+2);
|
\begin{tikzpicture}[declare function={
|
||||||
f2(\x) = 0.5*(2)^(\x-1);
|
g(\x) = 0.5*exp(\x-2); % base function for y(t)
|
||||||
f3(\x) = 0.5*(2)^(\x-1) - 10/(\x+2);
|
f(\x) = 0.5*exp(\x-2); % derivative
|
||||||
f4(\x) = 0.5*(2)^(\x-1) - 20/(\x+2);}]
|
%g(\x) = 0.5*(\x-2.7)^3 - 2*(\x-2.7)^2; % base function for y(t)
|
||||||
|
%f(\x) = 1.5*(\x-2.7)^2 - 4*(\x-2.7); % derivative
|
||||||
|
}]
|
||||||
|
\def\h{1} % step length (accuracy of approximation)
|
||||||
|
\def\torig{2} % y_0
|
||||||
|
\def\yorig{1} % t_0
|
||||||
\begin{axis}%
|
\begin{axis}%
|
||||||
[grid=none,
|
[grid=none,
|
||||||
%minor tick num=4,
|
|
||||||
grid style={line width=.1pt, draw=gray!10},
|
grid style={line width=.1pt, draw=gray!10},
|
||||||
major grid style={line width=.2pt,draw=gray!50},
|
major grid style={line width=.2pt,draw=gray!50},
|
||||||
axis lines=middle,
|
axis lines=middle,
|
||||||
%enlargelimits={abs=0.2},
|
|
||||||
ymax=10, ymin=-1.5,
|
ymax=10, ymin=-1.5,
|
||||||
|
restrict y to domain=-2:12,
|
||||||
xmin=-1, xmax=7,
|
xmin=-1, xmax=7,
|
||||||
xtick={2,3,4,5},
|
xtick={2,3,4,5},
|
||||||
ytick=\empty,
|
ytick=\empty,
|
||||||
xticklabels={$t_0$, $t_1$, $t_2$, $t_3$},
|
xticklabels={$t_0$, $t_1$, $t_2$, $t_3$},
|
||||||
%yticklabels={$y_0$, $y_1^{h}$, $y_2^{h}$},
|
|
||||||
xlabel=$t$,
|
xlabel=$t$,
|
||||||
ylabel=$x$,
|
ylabel=$y$,
|
||||||
|
legend pos=outer north east
|
||||||
]
|
]
|
||||||
\addplot[domain=0:10,samples=50,smooth,green] {f1(x)};
|
\def\d{0}
|
||||||
\addlegendentry{$y(t,t_0,y_0)$};
|
\def\t{0}
|
||||||
\addplot[domain=0:10,samples=50,smooth,blue] {f2(x)};
|
\foreach \i/\colour [remember=\d as \dlast (initially \yorig),
|
||||||
\addlegendentry{$y(t, t_1, y_1^{h})$};
|
remember=\t as \tlast (initially \torig)]
|
||||||
\addplot[domain=0:10,samples=50,smooth,orange] {f3(x)};
|
in {0/green,1/blue,2/orange,3/pink} {
|
||||||
\addlegendentry{$y(t, t_2, y_2^{h})$};
|
\tikzmath{\t=\tlast+\h;\d=g(\tlast)+\dlast+\h*f(\tlast)-g(\t);}
|
||||||
\addplot[domain=0:10,samples=50,smooth,pink] {f4(x)};
|
\colour
|
||||||
\addlegendentry{$y(t, t_3, y_3^{h})$};
|
\edef\temp{\noexpand
|
||||||
\draw (2,{f1(2)}) node[circle,fill,inner sep=0.5pt] {}
|
\addplot[domain=0:10,samples=50,smooth,\colour] {g(x) + \dlast - g(\torig)};
|
||||||
-- (3,{f2(3)}) node[circle,fill,inner sep=0.5pt] {}
|
}
|
||||||
-- (4, {f3(4)}) node[circle,fill,inner sep=0.5pt] {}
|
\temp
|
||||||
-- (5, {f4(5)}) node[circle,fill,inner sep=0.5pt] {};
|
\if\i3
|
||||||
\draw[dashed,green] (2, {f1(2)}) -- (0, {f1(2)}) node[label=left:$y_0$](){};
|
\edef\temp{\noexpand
|
||||||
\draw[dashed,blue] (3, {f2(3)}) -- (0, {f2(3)}) node[label=left:$y_1$](){};
|
\draw[dashed,->] (\tlast,{g(\tlast) + \dlast - g(\torig)})
|
||||||
\draw[dashed,orange] (4, {f3(4)}) -- (0, {f3(4)}) node[label=left:$y_2$](){};
|
-- (\t,{g(\t) + \d - g(\torig)});
|
||||||
\draw[dashed,pink] (5, {f4(5)}) -- (0, {f4(5)}) node[label=left:$y_3$](){};
|
}
|
||||||
|
\else
|
||||||
|
\edef\temp{\noexpand
|
||||||
|
\draw (\tlast,{g(\tlast) + \dlast - g(\torig)}) node[circle,fill,inner sep=0.5pt] {}
|
||||||
|
-- (\t,{g(\t) + \d - g(\torig)}) node[circle,fill,inner sep=0.5pt] {};
|
||||||
|
}
|
||||||
|
\fi
|
||||||
|
\temp
|
||||||
|
\edef\temp{\noexpand
|
||||||
|
\draw[dashed,\colour] (\tlast, {g(\tlast) + \dlast - g(\torig)}) -- (0, {g(\tlast) + \dlast - g(\torig)}) node[label=left:$y_{\i}$](){};
|
||||||
|
}
|
||||||
|
\temp
|
||||||
|
\edef\temp{\noexpand\addlegendentry{$y(t,t_{\i},y_{\i})$};}
|
||||||
|
\temp
|
||||||
|
}
|
||||||
\end{axis}
|
\end{axis}
|
||||||
\end{tikzpicture}
|
\end{tikzpicture}
|
||||||
\caption{Eulersches Polygonzugverfahren}
|
\caption{Eulersches Polygonzugverfahren, Steigung der Tangenten ist $f(t,y)$}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
\begin{enumerate}[1)]
|
\begin{enumerate}[1)]
|
||||||
\item \textbf{z.Z.} dass dieses Verfahren durchführbar ist, d.h. $\graph(y^h)\subset D$. Sei $(t,y^h(t))\subset D$ für $t_0 \le t\le t_{k-1}$. Dann gilt
|
\item \textbf{z.Z.} dass dieses Verfahren durchführbar ist, d.h. $\graph(y^h)\subset D$. Sei $(t,y^h(t))\subset D$ für $t_0 \le t\le t_{k-1}$. Dann gilt
|
||||||
|
|||||||
Binary file not shown.
+1
-1
@@ -27,7 +27,7 @@
|
|||||||
\RequirePackage{environ}
|
\RequirePackage{environ}
|
||||||
\RequirePackage{stackrel}
|
\RequirePackage{stackrel}
|
||||||
|
|
||||||
\usetikzlibrary{quotes, angles}
|
\usetikzlibrary{quotes, angles, math}
|
||||||
\pgfplotsset{compat=1.15} % or \pgfplotsset{compat=newest}
|
\pgfplotsset{compat=1.15} % or \pgfplotsset{compat=newest}
|
||||||
|
|
||||||
\geometry{
|
\geometry{
|
||||||
|
|||||||
Reference in New Issue
Block a user