diff options
Diffstat (limited to 'day1/session2.tex')
-rw-r--r-- | day1/session2.tex | 60 |
1 files changed, 22 insertions, 38 deletions
diff --git a/day1/session2.tex b/day1/session2.tex index 7242f6a..1a161e3 100644 --- a/day1/session2.tex +++ b/day1/session2.tex @@ -153,6 +153,7 @@ \frametitle{Simple Pendulum - L and T} \begin{itemize} \item Given data of Length and Time-period of a Simple pendulum + \item $T^2 = \frac{4\pi^2}{g}L$\\ \alert{{$L$} and {$T^2$} vary linearly} \item We wish to plot L vs. \alert{$T^2$} \end{itemize} \begin{lstlisting} @@ -166,28 +167,40 @@ In []: T = [0.6529, 0.8485, 1.0590, \end{frame} \begin{frame}[fragile] -\frametitle{Simple Pendulum \ldots} +\frametitle{Plotting $L$ vs. $T^2$} \begin{itemize} -\item Let us begin with $L$ vs. \alert{$T$} +\item We must square each of the values in T +\item How to do it? +\item T is a \kwrd{list} and we use a \kwrd{for} loop to iterate over it \end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Plotting $L$ vs $T^2$} \begin{lstlisting} - In []: plot(L, T) +In []: TSq = [] + +In []: for t in T: + ....: TSq.append(t*t) + +In []: plot(L, TSq) +Out[]: [<matplotlib.lines.Line2D object at 0xa5b05ac>] \end{lstlisting} -\begin{itemize} -\item But we wish to plot points! -\end{itemize} \end{frame} \begin{frame}[fragile] \frametitle{Plotting points} +\begin{itemize} +\item But we want to plot points! +\end{itemize} \begin{lstlisting} In []: clf() - In []: plot(L, T, 'o') + In []: plot(L, TSq, 'o') Out[]: [<matplotlib.lines.Line2D object at 0xac17e0c>] In []: clf() - In []: plot(L, T, '.') + In []: plot(L, TSq, '.') Out[]: [<matplotlib.lines.Line2D object at 0xac17e0c>] \end{lstlisting} \end{frame} @@ -202,28 +215,6 @@ In []: T = [0.6529, 0.8485, 1.0590, \end{itemize} \end{frame} -\begin{frame}[fragile] -\frametitle{Plotting $L$ vs. $T^2$} -\begin{itemize} -\item We must square each of the values in T -\item How to do it? -\item T is a \kwrd{list} and we use a \kwrd{for} loop to iterate over it -\end{itemize} -\end{frame} - -\begin{frame}[fragile] -\frametitle{Plotting $L$ vs $T^2$} -\begin{lstlisting} -In []: TSq = [] - -In []: for t in T: - ....: TSq.append(t*t) - -In []: plot(L, TSq, '.') -Out[]: [<matplotlib.lines.Line2D object at 0xa5b05ac>] -\end{lstlisting} -\end{frame} - \begin{frame}{New Concepts} \begin{itemize} \item lists @@ -385,17 +376,10 @@ Out[]: <type 'float'> \begin{frame}[fragile] \begin{figure} -\includegraphics[width=3.5in]{data/L-Tsq.png} +%\includegraphics[width=3.5in]{data/L-Tsq.png} \end{figure} \vspace{-0.2in} Coming up - \alert{Least Square Fit \ldots} \end{frame} - - - \end{document} - - - - |