Branches merged.
authorSantosh G. Vattam <vattam.santosh@gmail.com>
Tue, 05 Jan 2010 15:23:02 +0530
changeset 341 7ae88b9da553
parent 340 347ff2714deb (current diff)
parent 339 8ac5fe07810f (diff)
child 342 f91a75802238
Branches merged.
day1/cheatsheet1.tex
day1/cheatsheet2.tex
day1/cheatsheet4.tex
day1/cheatsheet6.tex
day1/data/pos.txt
--- a/.hgtags	Tue Dec 08 16:37:18 2009 +0530
+++ b/.hgtags	Tue Jan 05 15:23:02 2010 +0530
@@ -2,3 +2,4 @@
 919c93e5aa7113bb111211cfc7fad1ab852fcc4c bprim-v.10102009
 896f96b9de3b762e5626a55920b20ccc94d08f8c bprim-v.10102009p1
 49bdffe4dca565fed8f7e8ee3899bde0fa2a6b60 goaandcalicut-v.10112009
+2214b5dba4d4ee98f1d7083fee6f34b10111c536 scipy.in-v.14122009
--- a/day1/cheatsheet2.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/cheatsheet2.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -29,7 +29,7 @@
 \section{Plotting Points with Lists}
 
 \begin{lstlisting}
-In []: x = [0, 1, 2, 3]
+In []: x = [0, 1, 2, 3] # Creating a list
 In []: y = [7, 11, 15, 19]
 In []: plot(x, y)
 In []: clf()
--- a/day1/cheatsheet3.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/cheatsheet3.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -69,7 +69,7 @@
 \begin{lstlisting}
 In []: pie(science.values(), labels=science.keys())
 \end{lstlisting}
-Numpy Arrays
+Arrays
 \begin{lstlisting}
 In []: a = array([1, 2, 3]) #Creating
 In []: b = array([4, 5, 6])
@@ -77,7 +77,7 @@
 \end{lstlisting}
 Numpy statistical operations 
 \begin{lstlisting}
-In []: mean(math_scores)
+In []: mean(math_scores) 
 In []: median(math_scores)
 In []: std(math_scores)
 \end{lstlisting}
--- a/day1/cheatsheet4.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/cheatsheet4.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -38,7 +38,7 @@
 \typ{In []: B = ones_like(C)} \\
 B would be array of ones with the same shape and type as C.\\
 \typ{In []: A = ones((3,2))} \\
-A would be new array of given shape(arguments), filled with ones.\\ 
+A would be new matrix of given shape(arguments), filled with ones.\\ 
 \typ{In []: I = identity(3)}\\
 I would be identity matrix of shape 3x3
 
Binary file day1/data/after-filter.png has changed
Binary file day1/data/damp.png has changed
Binary file day1/data/four_plot.png has changed
Binary file day1/data/fsolve.png has changed
Binary file day1/data/image.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/day1/data/location.txt	Tue Jan 05 15:23:02 2010 +0530
@@ -0,0 +1,41 @@
+0.  0.
+0.25     0.47775
+0.5    0.931
+0.75     1.35975
+1.     1.764
+1.25     2.14375
+1.5    2.499
+1.75     2.82975
+2.     3.136
+2.25     3.41775
+2.5    3.675
+2.75     3.90775
+3.     4.116
+3.25     4.29975
+3.5    4.459
+3.75     4.59375
+4.     4.704
+4.25     4.78975
+4.5    4.851
+4.75     4.88775
+5.   4.9
+5.25     4.88775
+5.5    4.851
+5.75     4.78975
+6.     4.704
+6.25     4.59375
+6.5    4.459
+6.75     4.29975
+7.     4.116
+7.25     3.90775
+7.5    3.675
+7.75     3.41775
+8.     3.136
+8.25     2.82975
+8.5    2.499
+8.75     2.14375
+9.     1.764
+9.25     1.35975
+9.5    0.931
+9.75     0.47775
+10.   0.
Binary file day1/data/neighbour.png has changed
Binary file day1/data/ode.png has changed
Binary file day1/data/points.png has changed
--- a/day1/data/pos.txt	Tue Dec 08 16:37:18 2009 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-0.  0.
-0.25     0.47775
-0.5    0.931
-0.75     1.35975
-1.     1.764
-1.25     2.14375
-1.5    2.499
-1.75     2.82975
-2.     3.136
-2.25     3.41775
-2.5    3.675
-2.75     3.90775
-3.     4.116
-3.25     4.29975
-3.5    4.459
-3.75     4.59375
-4.     4.704
-4.25     4.78975
-4.5    4.851
-4.75     4.88775
-5.   4.9
-5.25     4.88775
-5.5    4.851
-5.75     4.78975
-6.     4.704
-6.25     4.59375
-6.5    4.459
-6.75     4.29975
-7.     4.116
-7.25     3.90775
-7.5    3.675
-7.75     3.41775
-8.     3.136
-8.25     2.82975
-8.5    2.499
-8.75     2.14375
-9.     1.764
-9.25     1.35975
-9.5    0.931
-9.75     0.47775
-10.   0.
Binary file day1/data/roots.png has changed
Binary file day1/data/smoothing.png has changed
--- a/day1/exercises.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/exercises.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -78,7 +78,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {7 November, 2009\\Day 1, Session 5}
+\date[] {11 January, 2010\\Day 1, Session 5}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -111,11 +111,37 @@
 \end{frame}
 
 
+\begin{frame}[fragile]
+  \frametitle{Problem 1}
+  \begin{columns}
+    \column{0.5\textwidth}
+    \hspace*{-0.5in}
+    \includegraphics[height=2in, interpolate=true]{data/L-Tsq.png}
+    \column{0.45\textwidth}
+    \begin{block}{Example code}
+    \tiny
+    \begin{lstlisting}
+l = []
+t = []
+for line in open('pendulum.txt'):
+    point = line.split()
+    l.append(float(point[0]))
+    t.append(float(point[1]))
+tsq = []
+for time in t:
+    tsq.append(time*time)
+plot(l, tsq, '.')
+    \end{lstlisting}
+    \end{block}
+  \end{columns}
+  \begin{block}{Problem Statement}
+    Tweak above code to plot data in file 'location.txt'.
+  \end{block}
+\end{frame}
+
 \begin{frame}
-  \frametitle{Problem 1}
+  \frametitle{Problem 1 cont...}
   \begin{itemize}
-  \item Open file 'pos.txt', it has X and Y Coordinate of a particle under motion
-  \item Plot X vs Y Graph.
   \item Label both the axes.
   \item What kind of motion is this?
   \item Title the graph accordingly.
@@ -123,13 +149,49 @@
   \end{itemize}
 \end{frame}
 
-\begin{frame}
+\begin{frame}[fragile]
   \frametitle{Problem 2}
-Write a Program that plots a regular n-gon(Let n = 5).
+  \begin{columns}
+    \column{0.5\textwidth}
+    \hspace*{-0.5in}
+    \includegraphics[height=2in, interpolate=true]{data/points}
+    \column{0.45\textwidth}
+    \begin{block}{Line between two points}
+    \tiny
+    \begin{lstlisting}
+In []: x = [1, 5]
+In []: y = [1, 4]
+In []: plot(x, y)
+    \end{lstlisting}
+    \end{block}
+  \end{columns}
+  Line can be plotted using arrays of coordinates.
+  \pause
+  \begin{block}{Problem statement}
+    Write a Program that plots a regular n-gon(Let n = 5).
+  \end{block}  
+\end{frame}
+
+
+\begin{frame}[fragile]
+  \frametitle{Problem 3}
+  \begin{columns}
+    \column{0.5\textwidth}
+    \hspace*{-0.5in}
+    \includegraphics[height=2in, interpolate=true]{data/damp}
+    \column{0.45\textwidth}
+    \begin{block}{Damped Oscillation}
+    \tiny
+    \begin{lstlisting}
+In []: x = linspace(0, 4*pi)
+In []: plot(x, exp(x/10)*sin(x))
+    \end{lstlisting}
+    \end{block}
+  \end{columns}
 \end{frame}
 
 \begin{frame}[fragile]
-  \frametitle{Problem 3}
+  \frametitle{Problem 3 cont...}
 Create a sequence of images in which the damped oscillator($e^{x/10}sin(x)$) slowly evolves over time.
 \begin{columns}
 \column{0.35\textwidth}
@@ -147,17 +209,71 @@
 \end{block}
 \end{frame}
 
-\begin{frame}
+\begin{frame}[fragile]
   \frametitle{Problem 4}
-  Legendre polynomials $P_n(x)$ are defined by the following recurrence relation
+  \begin{lstlisting}
+In []: x = imread('smoothing.png')
+In []: x.shape
+Out[]: (256, 256)
+In []: imshow(x,cmap=cm.gray)
+  \end{lstlisting}
+\emphbar{Replace each pixel with mean of neighboring pixels}
+  \begin{center}
+  \includegraphics[height=1in, interpolate=true]{data/neighbour}
+  \end{center}
+\end{frame}
+
+\begin{frame}
+  \begin{center}
+    \includegraphics[height=3in, interpolate=true]{data/smoothing}    
+  \end{center}
+\end{frame}
 
-\center{$(n+1)P_{n+1}(x) - (2n+1)xP_n(x) + nP_{n-1}(x) = 0$}\\
+\begin{frame}[fragile]
+  \frametitle{Problem 4: Approach}
+  For \typ{y} being resultant image:
+  \begin{lstlisting}
+y[1, 1] = x[0, 1]/4 + x[1, 0]/4 
+          + x[2, 1]/4 + x[1, 2]/4    
+  \end{lstlisting}
+   \begin{columns}
+    \column{0.45\textwidth}
+    \hspace*{-0.5in}
+    \includegraphics[height=1.5in, interpolate=true]{data/smoothing}
+    \column{0.45\textwidth}
+    \hspace*{-0.5in}
+    \includegraphics[height=1.5in, interpolate=true]{data/after-filter}
+  \end{columns}
+   \begin{block}{Hint:}
+     Use array Slicing.
+   \end{block}
+\end{frame}
 
-with $P_0(x) = 1$, $P_1(x) = x$ and $P_2(x) = (3x^2 - 1)/2$. Compute the next three 
-   Legendre polynomials and plot all 6 over the interval [-1,1].
+\begin{frame}[fragile]
+  \frametitle{Solution}
+  \begin{lstlisting}
+In []: y = zeros_like(x)
+In []: y[1:-1,1:-1] = x[:-2,1:-1]/4+
+                      x[2:,1:-1]/4+
+                      x[1:-1,2:]/4+
+                      x[1:-1,:-2]/4
+In []: imshow(y,cmap=cm.gray)
+  \end{lstlisting}
 \end{frame}
+
+
 \end{document}
 
+%% \begin{frame}
+%%   \frametitle{Problem 4}
+%%   Legendre polynomials $P_n(x)$ are defined by the following recurrence relation
+
+%% \center{$(n+1)P_{n+1}(x) - (2n+1)xP_n(x) + nP_{n-1}(x) = 0$}\\
+
+%% with $P_0(x) = 1$, $P_1(x) = x$ and $P_2(x) = (3x^2 - 1)/2$. Compute the next three 
+%%    Legendre polynomials and plot all 6 over the interval [-1,1].
+%% \end{frame}
+
 %% \begin{frame}[fragile] 
 %% \frametitle{Problem Set 5}
 %%   \begin{columns}
--- a/day1/session1.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/session1.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -77,7 +77,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {7 November, 2009\\Day 1, Session 1}
+\date[] {11 January, 2010\\Day 1, Session 1}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -125,28 +125,28 @@
 \begin{frame}
   \frametitle{Workshop Schedule: Day 1}
   \begin{description}
-	\item[Session 1] Sat 09:00--10:00
-	\item[Session 2] Sat 10:05--11:05
-	\item[Session 3] Sat 11:20--12:20
-	\item[Session 4] Sat 12:25--13:25
-        \item[Quiz 1] Sat 14:25--14:40
-        \item[Session 5] Sat 14:40--15:25
-        \item[Session 6] Sat 15:40--16:40
-        \item[Quiz 2] Sat 16:45--17:00
+	\item[Session 1] Mon 09:00--10:00
+	\item[Session 2] Mon 10:05--11:05
+	\item[Session 3] Mon 11:20--12:20
+	\item[Session 4] Mon 12:25--13:25
+        \item[Quiz 1] Mon 14:25--14:40
+        \item[Exercises] Mon 14:40--15:25
+        \item[Session 5] Mon 15:40--16:40
+        \item[Quiz 2] Mon 16:45--17:00
   \end{description}
 \end{frame}
 
 \begin{frame}
   \frametitle{Workshop Schedule: Day 2}
   \begin{description}
-	\item[Session 1] Sun 09:00--10:00
-	\item[Session 2] Sun 10:05--11:05
-	\item[Session 3] Sun 11:20--12:20
-	\item[Session 4] Sun 12:25--13:25
-        \item[Quiz 1] Sun 14:25--14:40
-        \item[Session 5] Sun 14:40--15:25
-        \item[Session 6] Sun 15:40--16:40
-        \item[Quiz 2] Sun 16:45--17:00
+	\item[Session 1] Tue 09:00--10:00
+	\item[Session 2] Tue 10:05--11:05
+	\item[Session 3] Tue 11:20--12:20
+	\item[Session 4] Tue 12:25--13:25
+        \item[Quiz 1]  Tue 14:25--14:40
+        \item[Exercises] Tue 14:40--15:25
+        \item[Session 5] Tue 15:40--16:40
+        \item[Quiz 2]  Tue 16:45--17:00
   \end{description}
 \end{frame}
 
@@ -189,7 +189,6 @@
     \item Images
       \begin{itemize}
       \item \typ{lena.png}
-      \item \typ{smoothing.gif}
       \end{itemize}
   \end{enumerate}
 \end{frame}
@@ -197,9 +196,9 @@
 \begin{frame}[fragile]
 \frametitle{Starting up \ldots}
 \begin{block}{}
-\begin{verbatim}
+\begin{lstlisting}
   $ ipython -pylab  
-\end{verbatim}
+\end{lstlisting} %$
 \end{block}
 \begin{lstlisting}     
   In []: print "Hello, World!"
@@ -448,25 +447,36 @@
 \item Annotate the origin
 \item Set axes limits to the range of x
 \end{enumerate}
+\vspace*{-0.1in}
+\begin{center}
+  \includegraphics[height=2.1in, interpolate=true]{data/four_plot}  
+\end{center}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Review Problem \ldots}
+\alert{Plotting \ldots}
 \begin{lstlisting}
 In []: x=linspace(-5*pi, 5*pi, 500)
 In []: plot(x, x, 'b')
 In []: plot(x, -x, 'b')
+In []: plot(x, sin(x), 'g', linewidth=2)
+In []: plot(x, x*sin(x), 'r', 
+            linewidth=3)
 \end{lstlisting}
 $\vdots$
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{Review Problem \ldots}
-\begin{lstlisting}
-In []: plot(x, sin(x), 'g', linewidth=2)
-In []: plot(x, x*sin(x), 'r', 
-            linewidth=3)
-\end{lstlisting}
+\alert{Legend \& Annotation\ldots}
 \begin{lstlisting}
 In []: legend(['x', '-x', 'sin(x)', 
                'xsin(x)'])
 In []: annotate('origin', xy = (0, 0))
+\end{lstlisting}
+\alert{Setting Axes limits\ldots}
+\begin{lstlisting}
 In []: xlim(-5*pi, 5*pi)
 In []: ylim(-5*pi, 5*pi)
 \end{lstlisting}
--- a/day1/session2.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/session2.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -78,7 +78,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {7 November, 2009\\Day 1, Session 2}
+\date[] {11 January, 2010\\Day 1, Session 2}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -418,12 +418,12 @@
   \end{lstlisting}
 This is what happens with \typ{line}
   \begin{lstlisting}
-In []: line = '1.2000e-01 7.4252e-01'
+In []: line = '1.20 7.42'
 
 In []: point = line.split()
 
 In []: point
-Out[]: ['1.2000e-01', '7.4252e-01']
+Out[]: ['1.20', '7.42']
   \end{lstlisting}
 \end{frame}
 
--- a/day1/session3.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/session3.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -79,7 +79,7 @@
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
 
-\date[] {7 November, 2009\\Day 1, Session 3}
+\date[] {11 January, 2010\\Day 1, Session 3}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -147,7 +147,7 @@
   ....     point = line.split()
   ....     l = float(point[0])
   ....     t = float(point[1])
-  ....     g = 4 * pi * pi * l / t * t
+  ....     g = 4 * pi * pi * l / (t * t)
   ....     G.append(g)
   \end{lstlisting}
 \end{frame}
@@ -166,8 +166,8 @@
 for g in G:
     total += g
 
-g_mean = total / len(g)
-print "Mean: ", g_mean
+g_mean = total / len(G)
+print 'Mean: ', g_mean
   \end{lstlisting}
 \end{frame}
 
@@ -175,7 +175,7 @@
   \frametitle{Mean ``g''}
   \begin{lstlisting}
 g_mean = sum(G) / len(G)
-print "Mean: ", g_mean
+print 'Mean: ', g_mean
   \end{lstlisting}
 \end{frame}
 
@@ -183,7 +183,7 @@
   \frametitle{Mean ``g''}
   \begin{lstlisting}
 g_mean = mean(G)
-print "Mean: ", g_mean
+print 'Mean: ', g_mean
   \end{lstlisting}
   \inctime{10}
 \end{frame}
@@ -277,11 +277,11 @@
 \begin{frame}[fragile]
   \frametitle{Dictionaries \ldots}
   \begin{lstlisting}
-In []: d = {"jpg" : "image file",
-      "txt" : "text file", 
-      "py" : "python code"}
+In []: d = {'jpg' : 'image file',
+      'txt' : 'text file', 
+      'py' : 'python code'}
 
-In []: d["txt"]
+In []: d['txt']
 Out[]: 'text file'
   \end{lstlisting}
 \end{frame}
@@ -289,10 +289,10 @@
 \begin{frame}[fragile]
   \frametitle{Dictionaries \ldots}
   \begin{lstlisting}
-In []: "py" in d
+In []: 'py' in d
 Out[]: True
 
-In []: "cpp" in d
+In []: 'cpp' in d
 Out[]: False
   \end{lstlisting}
 \end{frame}
@@ -417,11 +417,11 @@
 \begin{frame}[fragile]
   \frametitle{Obtaining statistics}
   \begin{lstlisting}
-print "Mean: ", mean(math_scores)
+print 'Mean: ', mean(math_scores)
 
-print "Median: ", median(math_scores)
+print 'Median: ', median(math_scores)
 
-print "Standard Deviation: ",
+print 'Standard Deviation: ',
               std(math_scores)
   \end{lstlisting}
   \inctime{10}
@@ -432,11 +432,11 @@
   \begin{lstlisting}
 math_array = array(math_scores)
 
-print "Mean: ", mean(math_array)
+print 'Mean: ', mean(math_array)
 
-print "Median: ", median(math_array)
+print 'Median: ', median(math_array)
 
-print "Standard Deviation: ",
+print 'Standard Deviation: ',
               std(math_array)
   \end{lstlisting}
   \inctime{5}
--- a/day1/session4.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/session4.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -79,7 +79,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {7 November, 2009\\Day 1, Session 4}
+\date[] {11 January, 2010\\Day 1, Session 4}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -287,8 +287,6 @@
 In []: imshow(a)
 Out[]: <matplotlib.image.AxesImage object at 0xa0384cc>
 
-In []: a.shape 
-Out[]: (512, 512, 4)
   \end{lstlisting}
 \end{small}
   \begin{itemize}
@@ -317,6 +315,11 @@
 \begin{frame}[fragile]
 \frametitle{Transpose of a Matrix}
 \begin{lstlisting}
+In []: a = array([[ 1,  1,  2, -1],
+  ...:            [ 2,  5, -1, -9],
+  ...:            [ 2,  1, -1,  3],
+  ...:            [ 1, -3,  2,  7]])
+
 In []: a.T
 Out[]:
 array([[ 1,  2,  2,  1],
@@ -485,7 +488,14 @@
 \frametitle{\typ{lstsq}}
 \begin{itemize}
 \item We need to fit a line through points for the equation $T^2 = m \cdot L+c$
-\item In matrix form, the equation can be represented as $T^2 = A \cdot p$, where A is   
+\item In matrix form, the equation can be represented as $T_{sq} = A \cdot p$, where $T_{sq}$ is
+  $\begin{bmatrix}
+  T^2_1 \\
+  T^2_2 \\
+  \vdots\\
+  T^2_N \\
+  \end{bmatrix}$
+, A is   
   $\begin{bmatrix}
   L_1 & 1 \\
   L_2 & 1 \\
--- a/day1/session5.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/session5.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -79,7 +79,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {31, October 2009\\Day 1, Session 5}
+\date[] {11, January 2010\\Day 1, Session 5}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
--- a/day1/session6.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1/session6.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -78,7 +78,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {7 November, 2009\\Day 1, Session 6}
+\date[] {11 January, 2010\\Day 1, Session 6}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -150,7 +150,6 @@
                       [-1, 0.5, -1]])
     In []: b = array([[1], [-2], [0]])
     In []: x = solve(A, b)
-    In []: Ax = dot(A,x)
   \end{lstlisting}
 \end{frame}
 
@@ -168,6 +167,7 @@
 \begin{frame}[fragile]
 \frametitle{Let's check!}
 \begin{lstlisting}
+In []: Ax = dot(A,x)
 In []: Ax
 Out[]: 
 array([[  1.00000000e+00],
@@ -216,11 +216,17 @@
 \frametitle{Scipy Methods - \typ{roots}}
 \begin{itemize}
 \item Calculates the roots of polynomials
+\item To calculate the roots of $x^2-5x+6$ 
 \end{itemize}
 \begin{lstlisting}
-  In []: coeffs = [1, 6, 13]
+  In []: coeffs = [1, -5, 6]
   In []: roots(coeffs)
+  Out[]: array([3., 2.])
 \end{lstlisting}
+\vspace*{-.2in}
+\begin{center}
+\includegraphics[height=1.6in, interpolate=true]{data/roots}    
+\end{center}
 \end{frame}
 
 \begin{frame}[fragile]
@@ -291,6 +297,9 @@
 In []: fsolve(f, 0)
 Out[]: -0.66623943249251527
 \end{lstlisting}
+\begin{center}
+\includegraphics[height=2in, interpolate=true]{data/fsolve}    
+\end{center}
 \end{frame}
 
 %% \begin{frame}[fragile]
@@ -318,6 +327,7 @@
 \item Define a function as below
 \end{itemize}
 \begin{lstlisting}
+In []: from scipy.integrate import odeint
 In []: def epid(y, t):
   ....     k, L = 0.00003, 25000
   ....     return k*y*(L-y)
@@ -338,6 +348,14 @@
 \end{frame}
 
 \begin{frame}[fragile]
+\frametitle{Result}
+\begin{center}
+\includegraphics[height=2in, interpolate=true]{data/image}  
+\end{center}
+\end{frame}
+
+
+\begin{frame}[fragile]
 \frametitle{ODEs - Simple Pendulum}
 We shall use the simple ODE of a simple pendulum. 
 \begin{equation*}
@@ -392,6 +410,12 @@
 \end{lstlisting}
 \end{frame}
 
+\begin{frame}[fragile]
+\frametitle{Result}
+\begin{center}
+\includegraphics[height=2in, interpolate=true]{data/ode}  
+\end{center}
+\end{frame}
 
 \begin{frame}
   \frametitle{Things we have learned}
--- a/day1quiz1.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day1quiz1.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -154,8 +154,12 @@
 %%   \end{lstlisting}
 %% \end{frame}
 
-\begin{frame}[fragile]
+\begin{frame}
 \frametitle{\incqno }
+What ipython magic command do you use to obtain the lines of code you have already typed in the interpreter? What command do you use to save them?
+\end{frame}
+
+\begin{frame}
 \begin{lstlisting}
 In []: sc = {'A': 10, 'B': 20, 
              'C': 70}
@@ -234,6 +238,38 @@
 Write the code to read a file \texttt{data.txt} and print each line of it?
 \end{frame}
 
+\begin{frame}[fragile]
+\frametitle{\incqno }
+What is the output of:
+\begin{lstlisting}
+In []: x=linspace(0 , 2 * pi)
+In []: plot(x, cos(x),'go')
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}
+\frametitle{\incqno }
+Draw a plot with line width 3.
+\end{frame}
+
+\begin{frame}
+\frametitle{\incqno }
+Setting x and y axis limits.
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{\incqno }
+The following code snippet has an error/bug:
+\begin{lstlisting}
+In []: l = [0.1, 0.2, 0.3, 0.4]
+In []: t = [0.69, 0.90, 1.19, 1.30]
+In []: tsq = []
+In []: for time in t:
+ ....:     tsq.append(time*time)
+ ....:     plot(l, tsq)
+\end{lstlisting}
+
+What is the error? How do you fix it?
+\end{frame}
 
 \end{document}
-
--- a/day2/cheatsheet1.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/cheatsheet1.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -108,7 +108,7 @@
 In []: 'x is %s, y is %s' %(x, y)
 Out[]: 'x is 1, y is 1.234'
   \end{lstlisting}
-\textbf{Note:} \typ{\%s} used in above fomatting specifies \typ{'str'} representation of variables. One can also try:\\
+\textbf{Note:} \typ{\%s} used in above formatting specifies \typ{'str'} representation of variables. One can also try:\\
 \typ{\%d} for \typ{int} representation\\
 \typ{\%f} for \typ{float} representation
 \begin{lstlisting}
--- a/day2/cheatsheet2.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/cheatsheet2.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -193,7 +193,7 @@
 \begin{lstlisting}
 In []: t = (1, 2, 3, 4, 5, 6, 7, 8) 
 \end{lstlisting}
-\textbf{Note:} For tupels we use parantheses in place of square brackets, rest is same as lists.
+\textbf{Note:} For tuples we use parentheses in place of square brackets, rest is same as lists.
 \begin{lstlisting}
 In []: t[0] + t[3] + t[-1] # elements are accessed via indices
 Out[]: 13
--- a/day2/cheatsheet3.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/cheatsheet3.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -50,7 +50,7 @@
 Out[]: -1
 In []: signum() # ERROR signum() takes exactly 1 argument(0 given)
 \end{lstlisting}
-\textbf{Note:} Arguments passed to a function are passed by-value \textbf{only if} they are basic Python data type(int, float). In case one passes immutable types(String, tupels), they cant be modified in the function, but objects like \typ{list} and dictionary can be manipulated.
+\textbf{Note:} Arguments passed to a function are passed by-value \textbf{only if} they are basic Python data type(int, float). In case one passes immutable types(String, tuples), they cant be modified in the function, but objects like \typ{list} and dictionary can be manipulated.
 \subsection{Default Arguments}
 This feature allow the functions to take the arguments optionally. For example:
 \begin{lstlisting}
@@ -80,12 +80,12 @@
 Hi Guido
 \end{lstlisting}
 \subsection{Keyword Arguments}
-This feature provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. You dont have to remember the order of the parameters in function definition. For example:
+This feature provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. You don't have to remember the order of the parameters in function definition. For example:
 \begin{lstlisting}
 In []: plot(y, sin(y), 'g', linewidth=2)
 In []: plot(y, cos(y), linewidth=1, color='g')
 \end{lstlisting}
-Both call to \typ{plot} function will work and paramenters are set accordingly.\\
+Both call to \typ{plot} function will work and parameters are set accordingly.\\
 One can define a function such that keyword arguments can be used in following way:
 \begin{lstlisting}
 def wish(name='World', greetings='Hello'):
@@ -97,8 +97,8 @@
 Hello World
 In [14]: wish(greetings='hey', name='madhu')
 hey madhu
-In [15]: wish(name='vattam', greetings = 'get lost')
-get lost vattam
+In [15]: wish(name='vattam', greetings = 'bye bye')
+bye bye vattam
 \end{lstlisting}
 % sorry Vattam just a joke :P
 \section{Self contained python script}
@@ -130,13 +130,13 @@
 \begin{lstlisting}
 In []: a = str() # initializing a string object.
 In []: b = "Hello World"
-In []: b.split() # calling funciton on object 'b'
+In []: b.split() # calling function on object 'b'
 Out[]: ['Hello', 'World']
 \end{lstlisting}
 ``.'' is a operator used to call functions defined for given object.
 \section{Links and References}
 \begin{itemize}
-\item Some of inbult functions available with Python are listed at\\ \url{http://docs.python.org/library/functions.html}
+\item Some of inbuilt functions available with Python are listed at\\ \url{http://docs.python.org/library/functions.html}
 \item Reference manual to describe the standard libraries  that are distributed with Python is available at \url{http://docs.python.org/library/} 
 \end{itemize}
 \end{document}
--- a/day2/exercises.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/exercises.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -78,7 +78,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {8 November, 2009\\Day 2}
+\date[] {12 January, 2010\\Day 2}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
--- a/day2/session1.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/session1.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -79,7 +79,7 @@
 \author[FOSSEE Team] {The FOSSEE Group}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {8 November, 2009\\Day 2, Session 1}
+\date[] {12 January, 2010\\Day 2, Session 1}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
--- a/day2/session2.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/session2.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -78,7 +78,7 @@
 \author[FOSSEE Team] {The FOSSEE Group}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {8 November, 2009\\Day 2, Session 2}
+\date[] {12 January, 2010\\Day 2, Session 2}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -535,4 +535,4 @@
   \end{itemize}
 \end{frame}
 
-\end{document}
\ No newline at end of file
+\end{document}
--- a/day2/session3.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/session3.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -78,7 +78,7 @@
 \author[FOSSEE Team] {The FOSSEE Group}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {8 November, 2009\\Day 2, Session 3}
+\date[] {12 January, 2010\\Day 2, Session 3}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
@@ -431,4 +431,4 @@
   \end{itemize}
 \end{frame}
 
-\end{document}
\ No newline at end of file
+\end{document}
--- a/day2/session4.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/session4.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -100,7 +100,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {8 November, 2009\\Day 2, Session 4}
+\date[] {12 January, 2010\\Day 2, Session 4}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 %\pgfdeclareimage[height=0.75cm]{iitblogo}{iitblogo}
@@ -553,4 +553,4 @@
 % %%     \end{block}
 %     
 % %% \inctime{15} 
-% %% \end{frame}
\ No newline at end of file
+% %% \end{frame}
--- a/day2/session5.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2/session5.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -100,7 +100,7 @@
 \author[FOSSEE] {FOSSEE}
 
 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date[] {8 November, 2009\\Day 2, Session 5}
+\date[] {12 January, 2010\\Day 2, Session 5}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
--- a/day2quiz.tex	Tue Dec 08 16:37:18 2009 +0530
+++ b/day2quiz.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -88,18 +88,6 @@
 0.5.
 \end{frame}
 
-\begin{frame}[fragile]
-\frametitle{\incqno }
-  What happens when we run this code?
-  \begin{lstlisting}
-a = False
-b = True
-c = True
-if a and b or c:
-    print "You are correct!"
-  \end{lstlisting}
-\end{frame}
-
 \begin{frame}
 \frametitle{\incqno }
   What is the difference between \kwrd{print} \emph{x} and \kwrd{print} \emph{x,} ?
@@ -134,7 +122,7 @@
 \begin{frame}[fragile]
     \frametitle{\incqno}
   \begin{lstlisting}
-In []: 47%3 
+In []: 47 % 3 
   \end{lstlisting}
   What is the output?
 \end{frame}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/schedule.tex	Tue Jan 05 15:23:02 2010 +0530
@@ -0,0 +1,48 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Tutorial slides on Python.
+%
+% Author: FOSSEE <info at fossee  dot in>
+% Copyright (c) 2005-2009, FOSSEE Team
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\documentclass[14pt]{article}
+
+\title{Python for Science and Engineering: Schedule}
+\author{FOSSEE Team}
+\date{14, 15 December, 2009}
+
+\begin{document}
+  \maketitle
+  Day 1, 14 December, 2009 \\
+  \begin{tabular}{| p{.35in} | p{2in} | p{1in} |}
+    \hline
+    Session & Title & Time \\\hline
+    1 & Interactive Plotting & 09:30 - 10:30 \\\hline
+    2 & Plotting experimental data & 10:35 - 11:35 \\\hline
+    & Tea Break & 11:35 - 11:50 \\\hline
+    3 & Statistics & 11:55 - 12:55 \\\hline
+    & Lunch Break & 12:55 - 13:50 \\\hline
+    & Quiz 1 & 13:50 - 14:05 \\\hline
+    4 & Matrices \& Least Square Fit & 14:10 - 15:10 \\\hline
+    5 & Exercises & 15:15 - 16:15 \\\hline
+    & Tea Break & 16:15 - 16:30 \\\hline
+    6 & Matrices \& Least Square Fit & 16:30 - 17:30 \\\hline
+    & Quiz 2 & 17:30 - 17:45 \\\hline
+  \end{tabular}
+  \vspace*{.5in}
+  \\ Day 2, 15 December, 2009 \\
+  \begin{tabular}{| p{.35in} | p{2in} | p{1in} |}
+    \hline
+    Session & Title & Time \\\hline
+    1 & Python language: Basics & 09:00 - 10:00 \\\hline
+    2 & Python language: Data structures and functions & 10:05 - 11:05 \\\hline
+    & Tea Break & 11:05 - 11:20 \\\hline
+    3 & Python language: Functions, modules and objects & 11:25 - 12:25 \\\hline
+    4 & Python Development & 12:25 - 13:25 \\\hline
+    & Lunch Break & 13:25 - 14:20 \\\hline
+    & Quiz 3 & 14:20 - 14:40 \\\hline
+    5 & Exercises & 14:40 - 15:40 \\\hline
+    & Tea Break & 15:40 - 16:00 \\\hline
+    6 & Exercises contd \ldots & 16:00 - 16:30 \\\hline
+  \end{tabular}
+\end{document}