# HG changeset patch # User Santosh G. Vattam # Date 1257934093 -19800 # Node ID c53251e506cc88ae1586da66e7617e5fb4028253 # Parent 26f5e864a135e05e63dbd39568a3d488c6248b44 Updated session 4 of day 1. diff -r 26f5e864a135 -r c53251e506cc day1/session4.tex --- a/day1/session4.tex Wed Nov 11 12:52:50 2009 +0530 +++ b/day1/session4.tex Wed Nov 11 15:38:13 2009 +0530 @@ -503,9 +503,24 @@ \end{frame} \begin{frame}[fragile] +\frametitle{Getting $L$ and $T^2$} +If you \alert{closed} IPython after session 2 +\begin{lstlisting} +In []: l = [] +In []: t = [] +In []: for line in open('pendulum.txt'): + .... point = line.split() + .... l.append(float(point[0])) + .... t.append(float(point[1])) + .... + .... +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] \frametitle{Generating $A$} \begin{lstlisting} -In []: A = array([L, ones_like(L)]) +In []: A = array([l, ones_like(l)]) In []: A = A.T \end{lstlisting} %% \begin{itemize} @@ -533,13 +548,13 @@ \frametitle{Least Square Fit Line \ldots} We get the points of the line from \typ{coef} \begin{lstlisting} -In []: Tline = coef[0]*L + coef[1] +In []: Tline = coef[0]*l + coef[1] \end{lstlisting} \begin{itemize} -\item Now plot Tline vs. L, to get the Least squares fit line. +\item Now plot \typ{Tline} vs. \typ{l}, to get the Least squares fit line. \end{itemize} \begin{lstlisting} -In []: plot(L, Tline) +In []: plot(l, Tline) \end{lstlisting} \end{frame}