X-Git-Url: https://hackdaworld.org/gitweb/?p=lectures%2Flatex.git;a=blobdiff_plain;f=computational_physics%2Fcp.tex;h=a320c48f92d678157b631540eafc861a8de91000;hp=eaaff90a7ab652d882c2164d09ecb729d19a1694;hb=a5ba283663603f254cff004e2c7842f4a63286de;hpb=15ad0acff7edd0cbe2c85036d9e663facee85819 diff --git a/computational_physics/cp.tex b/computational_physics/cp.tex index eaaff90..a320c48 100644 --- a/computational_physics/cp.tex +++ b/computational_physics/cp.tex @@ -9,7 +9,7 @@ \usepackage{aecompl} \usepackage{color} \usepackage{graphicx} -\graphicspath{{./}} +\graphicspath{{./img/}} \usepackage{hyperref} \title{introduction to computational physics} @@ -58,41 +58,105 @@ $\Rightarrow$ study and implementation of numerical algorithms \overlays{5}{ \begin{slide}{history of computing hardware} -\begin{tabular}{rc} - \begin{minipage}{4cm} - \onlySlide*{1}{\includegraphics[width=4cm]{abacus.eps}} - \onlySlide*{2}{\includegraphics[width=4cm]{eniac.eps}} - \onlySlide*{3}{\includegraphics[width=4cm]{z1.eps}} - \FromSlide{4}{\includegraphics[width=4cm]{pdp1.eps}} - \end{minipage} & - \begin{minipage}{7cm} + \begin{minipage}[t]{10cm} + \onlySlide*{1}{\begin{center} \includegraphics[height=3cm]{abacus.eps} \end{center}} + \onlySlide*{2}{\begin{center} \includegraphics[height=3cm]{eniac.eps} \hspace{1cm} \includegraphics[height=3cm]{tube.eps} \end{center}} + \onlySlide*{3}{\begin{center} \includegraphics[height=3cm]{z1.eps} \end{center}} + \onlySlide*{4}{\begin{center} \includegraphics[height=3cm]{pdp1.eps} \hspace{1pt} \includegraphics[height=3cm]{transistor.eps} \end{center}} + \onlySlide*{5}{\begin{center} \includegraphics[height=3cm]{pdp8.eps} \hspace{1cm} \includegraphics[height=3cm]{ic.eps} \end{center}} + %\FromSlide{6}{\begin{center} \includegraphics[height=3cm]{} \end{center}} + \end{minipage} + \begin{minipage}[b]{10cm} \begin{itemstep} - \item $3000 bc$: abacus\\ - first calculating device - \item $1945$: eniac\\ - electrical digital computer - \item $1938/41$: z1/3\\ - featuring memory and programmability - \item $1960$: transistor based computers + \item $3000 \, bc$: abacus - first calculating device + \item $1945$: eniac - electrical digital computer + \item $1938/41$: z1/3 - featuring memory and programmability + \item $1960$: pdp-1 - transistor based computers + \item $1964$: pdp-8 - integrated circuit computers \end{itemstep} \end{minipage} -\end{tabular} -\FromSlide{5}{ -foo -} \end{slide}} -\begin{slide}{} - -\end{slide} +\overlays{6}{ +\begin{slide}{history of computing hardware} + \begin{minipage}[t]{10cm} + \onlySlide*{1}{\begin{center} \includegraphics[height=3cm]{4004.eps} \end{center}} + \onlySlide*{2}{\begin{center} \includegraphics[height=3cm]{cray2.eps} \hspace{1pt} \includegraphics[height=3cm]{cray2_i.eps} \end{center}} + \onlySlide*{3}{\begin{center} \includegraphics[height=3cm]{apple2.eps} \includegraphics[height=3cm]{c64.eps} \end{center}} + \onlySlide*{4}{\begin{center} \includegraphics[height=3cm]{intel1.eps} \includegraphics[height=3cm]{intel2.eps} \end{center}} + \onlySlide*{5}{\begin{center} \includegraphics[height=3cm]{mips.eps} \hspace{1pt} \includegraphics[height=3cm]{ppc.eps} \end{center}} + \onlySlide*{6}{\begin{center} \includegraphics[height=3cm]{cluster1.eps} \hspace{1cm} \includegraphics[height=3cm]{cluster2.eps} \end{center}} + \end{minipage} + \begin{minipage}[b]{10cm} + \begin{itemstep} + \item $1970$: intel 4004 - first single chip $\mu$-processor + \item $1977/85$: cray1/2 - vector supercomputer + \item $1977/82/85$: 6502/6510/m68k - first pc + \item $1978/82/85 $: 8086/80286/80386 + \item $1985$: mips - first risc design + \item $1990/2000$: massive parallel computing + \end{itemstep} + \end{minipage} +\end{slide}} -\begin{slide}{} +\overlays{11}{ +\begin{slide}{history of computing software} + \begin{itemstep} + \item $1946$: plankalk"ul - high-level programming language + \item $1950$: assembler - translating instruction mnemonics + \item $1954$: fortran - {\scriptsize formula translation} + \item $1963$: basic - {\scriptsize beginner's all purpose symbolic instruction code} + \item $1964$: os/360 - batch processing operating system + \item $1969$: unix - multics port to pdp-8, pdp-11/20 + \item $1972$: c programming language - thompson, ritchie + \item $1978/84/85$: apple os/atari, amiga os/mac os + \item $1981/85/92/95$: ms-dos/windows 1.0/3.x/95 + \item $1983$: gnu project - unix-like free software development + \item $1991$: linux - open-source kernel + \end{itemstep} +\end{slide}} -\end{slide} +\overlays{4}{ +\begin{slide}{warning - machine accuracy $\epsilon_m$} + \begin{itemstep} + \item numerical precision of 64-bit floating point \\ + ieee floating point format: $v = -1^s 2^{-e} m$ + \[ + \begin{array}{lll} + s: & \textrm{signe} & \textrm{1 bit} \\ + m: & \textrm{mantissa} & \textrm{52 bit} \\ + e: & \textrm{exponent} & \textrm{11 bit} \\ + \end{array} + \] + \item $\epsilon_m$: smallest floating point with $1 + \epsilon_m \neq 1$ \\ + $\epsilon_m \approx 2 \times 10^{-18}$ \hspace{2pt} (roundoff error) + \item $N$ arithmetic operations $\Rightarrow$ error of order $N \epsilon_m$ + \item subtraction of very nearly equal numbers\\ + (difference in few significant low-order bits) + \end{itemstep} +\end{slide}} -\begin{slide}{} +\overlays{6}{ +\begin{slide}{warning - truncation error} + \begin{itemstep} + \item discrete approximation of continuous quantity + \item truncation error $\equiv$ discrepancy between true answer and practical calculation + \item persists even on hypothetical perfect computer ($\epsilon_m = 0$) + \item machine independent, characteristic of used algorithm + \item numerical analysis: minimizing truncation error + \item unstable method: roundoff error interacting at early stage + \end{itemstep} +\end{slide}} -\end{slide} +\overlays{4}{ +\begin{slide}{warning - recursive functions} + \begin{itemstep} + \item avoid recursive functions! + \verbatiminput{fak1.c} + \item better: + \verbatiminput{fak2.c} + \end{itemstep} +\end{slide}} \begin{slide}{computational techniques} techniques discussed in the talk: @@ -113,7 +177,7 @@ techniques discussed in the talk: \end{slide} \begin{slide}{computational techniques} -techniques \textcolor{red}{not yet} discussed in the talk:\footnote{if time is available this will be completed. read more at http://www.nr.com} +techniques \textcolor{red}{not yet} discussed in the talk:\footnote{if time is available this will be completed. updates at:\\http://www.physik.uni-augsburg.de/\~{}zirkelfr/download/cp/cp.pdf\\read more at: http://www.nr.com} \begin{itemize} %\item rough discretization %\item solution of linear algebraic equations @@ -131,4 +195,115 @@ techniques \textcolor{red}{not yet} discussed in the talk:\footnote{if time is a \hspace{6cm} \end{slide} +\overlays{2}{ +\begin{slide}{rough discretization} + \begin{itemstep} + \item example: homogenous field of force $\vec{F} = (0,-mg)$ \\ + \begin{tabular}{ll} + equation of motion: & $\vec{F} = m \vec{a} = m \frac{d^2 \vec{r}}{dt^2}$ \\ + initial condition: & $\vec{r}(t=0) = \vec{r_0} = (x_0,y_0)$ \\ + & $\frac{d \vec{r}}{dt}|_{t=0} = (v_{x_0},v_{y_0})$ \\ + \end{tabular} + \item algorithm using discretized time ($T_{total} = N \tau$): + \begin{tabular}{lll} + $x^1 = x_0;$ & $y^1 = y_0;$ & \\ + $v^1_x = v_{x_0};$ & $v^1_y = v_{y_0};$ & \\ + loop: & $x^2 = x^1 + \tau v^1_x;$ & $y^2 = y^1 + \tau v^1_y;$ \\ + & $v^2_x = v^1_x;$ & $v^2_y = v^1_y + (-mg) \tau;$ \\ + & $x^1 = x^2;$ & $y^1 = y^2$ \\ + & $v^1_x = v^2_x;$ & $v^1_y = v^2_y;$ \\ + \end{tabular} + \end{itemstep} +\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + +%\overlays{3}{ +%\begin{slide}{} +% \begin{itemstep} +% \item +% \item +% \item +% \end{itemstep} +%\end{slide}} + \end{document}