\documentclass[12pt,a4paper]{report}
\usepackage{latexsym,amssymb,german,a4wide,verbatim,xr}
\usepackage{fancyhdr} 
%\usepackage{pgffor}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{mathtools}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}

% use labels from a different document
%\usepackage{xr}
% optional \externaldocument[blablbla]{...} to avoid multiple labels \ref{blablablaLABEL}
% is used to get the correct references from the external document
%\externaldocument{../vorles/vorles}

% include graphical environment
%\usepackage{graphics}

% include self defined matrix symbols
%\usepackage{matrix}

%\newcommand*{\pathToExercises}{../../Material_NumerikI_Matthias}
% use selfdefined commands
%\input{\pathToExercises/vorles/meinstil.def}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Layout
%\addtolength{\topmargin}{-15ex}
%\addtolength{\textheight}{20ex}
\setlength{\headheight}{28pt}
\lhead{Technische Universität Berlin\\Numerische Mathematik I - WS 2019/2020}
\rhead{Prof.~V.~Mehrmann}
\cfoot{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\CurrentWeekNb}{2}
\newcounter{taskNb}
\stepcounter{taskNb}

\begin{document}
%\thispagestyle{AbgabeDatum}
\begin{center}
%{\LARGE Numerische Mathematik}\\[1.5ex]
%%{\large \CurrentWeekNb. \"Ubungsblatt}\\ 
{\Large Vorschlagsaufgaben für die \CurrentWeekNb. Tutorien}\\ 
{Woche 28.10-1.11.19}\\
%\\{Diese Aufgaben müßen spätestens am 24.10.19 in der Vorlesung abgegeben werden.}
%{Abgabe:} Spätestens am 24.10.19 in der Vorlesung\\[0.5cm]
\end{center}
%\hfill {Abgabe: Spätestens am 24.10.19 in der Vorlesung}\\[0.5cm]
%
%%\def\exerciseList{001, 002, 003}
%\begin{enumerate}
%
\begin{enumerate} 
\item $\Phi(t,y,h)=\frac{1}{2}[f(t,y) + f(t+h, y+ hf(t,y)) ]$
\begin{enumerate}
\item  Lipschitz condition: $|f(t,y_1)-f(t,y_2)| \leq L |y_1-y_2|$ für alle $t$, $h$.\\
%$\Phi(t,y,h)=\frac{1}{2}[f(t,y) + f(t+h, y+ hf(t,y)) ]$
\[
\begin{aligned}
 |\Phi(t,y_1,h)&-\Phi(t,y_2,h) |=\\
 &\frac{1}{2}|f(t,y_1) -f(t,y_2)  + f(t+h, y_1+ hf(t,y_1))- f(t+h, y_2+ hf(t,y_2)) |\\
 & \leq \frac{1}{2}\left(L|y_1 -y_2| + |f(t+h, y_1+ hf(t,y_1))- f(t+h, y_2+ hf(t,y_2)) |\right)\\
 &\leq \frac{1}{2}\left(L|y_1 -y_2| + L|y_1+ hf(t,y_1) -y_2- hf(t,y_2) |\right)\\
  &\leq \frac{1}{2}\left(2L|y_1 -y_2| + Lh|f(t,y_1) -f(t,y_2) |\right)\\
   &\leq \frac{1}{2}\left(2L|y_1 -y_2| + L^2h|y_1 -y_2|\right) = \frac{2L+L^2h}{2}|y_1 -y_2|
\end{aligned}
\]
\item First we remark that the solution is of the form
\[
y(t)=C\exp(2t)
\]
for a constant $C$ which should satisfy the initial condition
\[
y(0)=C=2.
\]
Thus the solution is $y(t)=2\exp(2t)$.
Secondly we remark that $f$ doesn't depend explicitly on $t$, so $f(t, y(t))=2y(t)=f(y(t))$. We now compute
\[
\begin{aligned}
 u_0&=2\\
 %\tilde{u}_1&=u_0+hf(u_0)=2+h f(2) = 2 +2\cdot 2h =u_0+h2u_0= u_0 (1+2h) \\
 \tilde{u}_1&= u_0+hf(u_0)=u_0 (1+2h) \\
 %u_1&=2+\frac{h}{2}\left(f(u_0) + f(\tilde{u}_1)\right)=2+\frac{h}{2}\left(4 + 4+8h)\right) = 2+h(4+4h)\\
 u_1&=u_0+\frac{h}{2}\left(2u_0 + 2\tilde{u}_1\right)=u_0+h(u_0 + u_0 (1+2h))=u_0(1+2h+2h^2)\\
% \tilde{u}_2&=u_1+hf(u_1)=2+4h+4h^2 + h \left(4+4h)+h f(2+h(4+4h)\right) = ...\\
 \tilde{u}_2&= u_1+hf(u_1)=u_1(1+2h)=u_0(1+2h+2h^2)  (1+2h)  \\%
 %=u_1+hf(u_1)=2+4h+4h^2 + h \left(4+4h)+h f(2+h(4+4h)\right) = ...\\
 y_2&=u_1+\frac{h}{2}\left(2u_1 + 2\tilde{u}_2\right)=u_1(1+2h+2h^2) = u_0(1+2h+2h^2)^2  \\
 \vdots\\
 u_k& = u_0(1+2h+2h^2)^k  \\
\end{aligned}
\]
We denote by $N(h)\in \mathbb{N}$ the number of steps that are necessary to attain or overtake a given (and fixed) time $\hat{t}$ with steps of size $h$, i.e. $N(h)\coloneqq\ceil{\hat{t}/h}$. It is clear that $N(h)\cdot h \to \hat{t}$ as $h\to 0$, and $N(h)\to \infty$ as $h\to 0$.
Therefore the numerical solution at the time $\tilde{t}(h)\coloneqq\ceil{\hat{t}/h} h \approx \hat{t}$ is given by
\[
u_h(\tilde{t})=u_{N} = u_0\left(1+2\frac{\tilde{t}}{N}+2\left(\frac{\tilde{t}}{N}\right)^2\right)^N 
\]
which tends to
\[
\lim\limits_{N\to \infty}u_0\left(1+2\frac{\hat{t}}{N}+2\left(\frac{\hat{t}}{N}\right)^2\right)^N = u_0\exp(2\hat{t}) =2\exp(2\hat{t})
\]
as $h\to 0$.
Since this is valid for any time $\hat{t}$, it follows that the numerical solution converges to the analytical one as $h\to 0$.
\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item
\begin{enumerate}
\item 
\[
(12.152)_{10}= 1*2^3+ 1*2^2+ 0*2^1 + 0*2^0 + 0*2^{-1} + 0*2^{-2} +1*2^{-3}= (1100.001)_{2}
\]
In normalized form: $(12.152)_{10}= (0.1100001)_{2} \cdot 2^{4}$.\\

Note that $16^{-1}=0.0625$. In the hexadecimal representation we consider the digit \{0, 1, 2, 3 ,4 ,5 ,6 ,7 ,8 ,9 ,A ,B ,C ,D ,E ,F\}.
It follows that
\[
(12.152)_{10}= 0*16^1+ C*16^0+ 2*16^{-1}= (C.2)_{16}.
\]
In normalized form: $(12.152)_{10}= (0.C2)_{16} \cdot 16^{1}$.
\item $0.1$ cannot be represented exactly with a finite number of digits in the binary and hexadecimal systems. Indeed
\[
\begin{aligned}
(0.1)_{10}&= 1.6\cdot 2^{-4} = (2^0+0.6)\cdot 2^{-4} &&\Rightarrow (0.1)_{10}\approx (0.0001)_{2}\\
(0.6)_{10}&= 1.2\cdot 2^{-1} = (2^0+0.2)\cdot 2^{-1} &&\Rightarrow (0.1)_{10}\approx (0.00011)_{2}\\
(0.2)_{10}&= 1.6\cdot 2^{-3} = (2^0+0.6)\cdot 2^{-3}&&\Rightarrow (0.1)_{10}\approx (0.00011001)_{2}\\
(0.6)_{10}&= 1.2\cdot 2^{-1} = (2^0+0.2)\cdot 2^{-1}&&\Rightarrow (0.1)_{10}\approx (0.000110011)_{2}\\
\vdots\\
(0.1)_{10}&=(0.0\overline{0011})_{2}
\end{aligned}
\]
In normalized form: $(0.1)_{10}=(0.\overline{1100})_{2} \cdot 2^{-3}$.\\

Moreover,
\[
\begin{aligned}
(0.1)_{10}&= 1.6\cdot 16^{-1} = (16^0+0.6)\cdot 16^{-1} &&\Rightarrow (0.1)_{10}\approx (0.1)_{16}\\
(0.6)_{10}&= 9.6\cdot 16^{-1} = (9*16^0+0.6)\cdot 16^{-1} &&\Rightarrow (0.1)_{10}\approx (0.19)_{16}\\
(0.6)_{10}&= 9.6\cdot 2^{-1} = (2^0+0.9)\cdot 16^{-1}&&\Rightarrow (0.1)_{10}\approx (0.199)_{16}\\
\vdots\\
(0.1)_{10}&=(0.1\overline{9})_{16}.
\end{aligned}\]

\end{enumerate}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item 
\begin{enumerate}
\item The method is not explicit, which means that one has to solve a nonlinear equation of the form
\[
g(u_{i+1})=u_{i+1}-u_i-hf(t_{i+1}, u_{i+1})=0
\] in order to find $u_{i+1}$.

\item Local discretization error: \[\tau_h = \frac{y(t+h)-y(t)}{h}-f(t+h, y(t+h))
\]
Taylor expansion of $y(t+h)$:
\[
y(t+h)=y(t)+h\dot{y}(t)+\frac{h^2}{2}\ddot{y}(t)+\mathcal{O}(h^3)
\]
Taylor expansion of $f(t+h, y(t+h))=\dot{y}({t+h})$:
\[
\dot{y}(t+h)=\dot{y}(t)+h\ddot{y}(t)+\mathcal{O}(h^2)
\]
Therefore
\[
\tau_h=\dot{y}(t)+\frac{h}{2}\ddot{y}(t)+\mathcal{O}(h^2) - \dot{y}(t)-h\ddot{y}(t)+\mathcal{O}(h^2) = \mathcal{O}(h),
\]
which shows that the consistence order is $p=1$ (if $f$ is smooth enough, so that one can take the second and third derivatives of $y$).
\item Es gilt
\[
\begin{aligned}
y(t_{i+1})&=y(t_i)+hf(t_{i+1}, y(t_{i+1})) + h \tau_h\\
u_{i+1} &= u_i+hf(t_{i+1}, u_i+1),
\end{aligned}
\]
und deswegen
\[
\begin{aligned}
|e_h(t_{i+1})|&=|y(t_i)+hf(t_{i+1}, y(t_{i+1})) + h \tau_h-u_i-hf(t_{i+1}, u_{i+1}) | \\
&= |e_h(t_i)+h\left[f(t_{i+1}, y(t_{i+1}))-f(t_{i+1}, u_{i+1}) \right]+h\tau_h|\\
&\leq |e_h(t_i)|+h|f(t_{i+1}, y(t_{i+1}))-f(t_{i+1}, u_{i+1})| +h|\tau_h|\\
&\leq |e_h(t_i)|+hL|y(t_{i+1})- u_{i+1}| +h|\tau_h|\\
&=|e_h(t_i)|+hL|e_h(t_{i+1})| +h|\tau_h|.
\end{aligned}
\]
Daraus folgt die Ungleichung.
\end{enumerate}
\end{enumerate}


\end{document}


