summaryrefslogtreecommitdiff
path: root/day1
diff options
context:
space:
mode:
Diffstat (limited to 'day1')
-rw-r--r--day1/session1.tex58
-rw-r--r--day1/session2.tex9
-rw-r--r--day1/session4.tex156
3 files changed, 174 insertions, 49 deletions
diff --git a/day1/session1.tex b/day1/session1.tex
index 56b8265..e19607b 100644
--- a/day1/session1.tex
+++ b/day1/session1.tex
@@ -122,6 +122,64 @@
%% % You might wish to add the option [pausesections]
%% \end{frame}
+\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:40
+ \item[Session 6] Sat 15:55--16:55
+ \item Quiz -2 Sat 17:00--17:15
+ \end{description}
+
+ \begin{block}{Goal of the workshop}
+ At the end of this program, successful participants will be able to use python as their scripting and problem solving language. Aimed at Engg. students--focus on basic numerics and plotting-- but should serve a similar purpose for others.
+ \end{block}
+\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:40
+ \item[Session 6] Sun 15:55--16:55
+ \item Quiz -2 Sun 17:00--17:15
+ \end{description}
+
+\begin{frame}{About the Workshop}
+ \begin{block}{Intended Audience}
+ \begin{itemize}
+ \item Engg., Mathematics and Science teachers.
+ \item Interested students from similar streams.
+ \end{itemize}
+ \end{block}
+
+ \begin{block}{Goal:}
+ Successful participants will be able to
+ \begin{itemize}
+ \item use Python as their scripting and problem solving language.
+ \item train the students to use Python for the same
+ \end{itemize}
+ \end{block}
+\end{frame}
+
+\end{frame}
+\begin{frame}{Checklist}
+ \begin{block}{IPython}
+ Type ipython at the command line. Is it available?
+ \end{block}
+ \begin{block}{Editor}
+ We recommend scite.
+ \end{block}
+ \end{description}
+\end{frame}
\begin{frame}[fragile]
\frametitle{Starting up...}
diff --git a/day1/session2.tex b/day1/session2.tex
index 03a4bd3..d87daf6 100644
--- a/day1/session2.tex
+++ b/day1/session2.tex
@@ -261,7 +261,7 @@ Out[]: [2, 3]
\end{frame}
\begin{frame}[fragile]
- \frametitle{List operations}
+\frametitle{List operations}
\begin{lstlisting}
In []: anthrlst = [6,7,8,9]
In []: lnglst = lst + anthrlst
@@ -279,12 +279,12 @@ Out[]: [1, 2, 3, 4, 5, 6]
\section{Simple Pendulum}
\begin{frame}[fragile]
\frametitle{Simple Pendulum - L and T}
-Let us look at a more realistic example of the Simple Pendulum experiment.
+Let us look at the example of the Simple Pendulum experiment.
\begin{center}
\begin{small}
\begin{tabular}{| c | c | c |}
\hline
-L & T & $T^2$ \\ \hline
+$L$ & $T$ & $T^2$ \\ \hline
0.1 & 0.6900 & \\ \hline
0.2 & 0.8989 & \\ \hline
0.3 & 1.1867 & \\ \hline
@@ -366,9 +366,6 @@ In []: for num in lst:
Lets look at the pendulum.txt file.
\begin{lstlisting}
$cat data/pendulum.txt
-\end{lstlisting}
-%%$
-\begin{lstlisting}
1.0000e-01 6.9004e-01
1.1000e-01 6.9497e-01
1.2000e-01 7.4252e-01
diff --git a/day1/session4.tex b/day1/session4.tex
index 68fe51b..f6351a6 100644
--- a/day1/session4.tex
+++ b/day1/session4.tex
@@ -96,13 +96,13 @@
\end{frame}
}
-%%\AtBeginSection[]
-%%{
- %%\begin{frame}<beamer>
-%% \frametitle{Outline}
- %% \tableofcontents[currentsection,currentsubsection]
- %%\end{frame}
-%%}
+\AtBeginSection[]
+{
+ \begin{frame}<beamer>
+ \frametitle{Outline}
+ \tableofcontents[currentsection,currentsubsection]
+ \end{frame}
+}
% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command:
@@ -136,30 +136,73 @@ let us now look at matrices in a little more detail.
\begin{frame}[fragile]
\frametitle{Matrices: Initializing}
\begin{lstlisting}
- In []: a = matrix([[1,2,3],
- [4,5,6],
- [7,8,9]])
-
- In []: a
- Out[]:
- matrix([[1, 2, 3],
- [4, 5, 6],
- [7, 8, 9]])
+In []: A = ([[5, 2, 4],
+ [-3, 6, 2],
+ [3, -3, 1]])
+
+In []: A
+Out[]: [[5, 2, 4],
+ [-3, 6, 2],
+ [3, -3, 1]]
\end{lstlisting}
\end{frame}
\subsection{Basic Operations}
+
\begin{frame}[fragile]
-\frametitle{Inverse of a Matrix}
+\frametitle{Transpose of a Matrix}
+\begin{lstlisting}
+In []: linalg.transpose(A)
+Out[]:
+matrix([[ 5, -3, 3],
+ [ 2, 6, -3],
+ [ 4, 2, 1]])
+\end{lstlisting}
+\end{frame}
+\begin{frame}[fragile]
+ \frametitle{Sum of all elements}
+ \begin{lstlisting}
+In []: linalg.sum(A)
+Out[]: 17
+ \end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{Matrix Addition}
+ \begin{lstlisting}
+In []: B = matrix([[3,2,-1],
+ [2,-2,4],
+ [-1, 0.5, -1]])
+
+In []: linalg.add(A, B)
+Out[]:
+matrix([[ 8. , 4. , 3. ],
+ [-1. , 4. , 6. ],
+ [ 2. , -2.5, 0. ]])
+ \end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Matrix Multiplication}
+\begin{lstlisting}
+In []: linalg.multiply(A, B)
+Out[]:
+matrix([[ 15. , 4. , -4. ],
+ [ -6. , -12. , 8. ],
+ [ -3. , -1.5, -1. ]])
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Inverse of a Matrix}
\begin{small}
\begin{lstlisting}
In []: linalg.inv(A)
Out[]:
-matrix([[ 0.07734807, 0.01657459, 0.32044199],
- [ 0.09944751, -0.12154696, -0.01657459],
- [-0.02762431, -0.07734807, 0.17127072]])
-
+array([[ 0.28571429, -0.33333333, -0.47619048],
+ [ 0.21428571, -0.16666667, -0.52380952],
+ [-0.21428571, 0.5 , 0.85714286]])
\end{lstlisting}
\end{small}
\end{frame}
@@ -167,34 +210,48 @@ matrix([[ 0.07734807, 0.01657459, 0.32044199],
\begin{frame}[fragile]
\frametitle{Determinant}
\begin{lstlisting}
- In []: linalg.det(a)
- Out[]: -9.5171266700777579e-16
+In []: det(A)
+Out[]: 42.0
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
-\frametitle{Computing Norms}
+\frametitle{Eigen Values and Eigen Matrix}
+\begin{small}
\begin{lstlisting}
- In []: linalg.norm(a)
- Out[]: 16.881943016134134
+In []: linalg.eig(A)
+Out[]:
+(array([ 7., 2., 3.]),
+ matrix([[-0.57735027, 0.42640143, 0.37139068],
+ [ 0.57735027, 0.63960215, 0.74278135],
+ [-0.57735027, -0.63960215, -0.55708601]]))
\end{lstlisting}
+\end{small}
\end{frame}
\begin{frame}[fragile]
-\frametitle{Eigen Values and Eigen Matrix}
-\begin{small}
+\frametitle{Computing Norms}
\begin{lstlisting}
- In []: linalg.eigvals(a)
- Out[]: array([1.61168440e+01, -1.11684397e+00, -1.22196337e-15])
-
- In []: linalg.eig(a)
- Out[]:
- (array([ 1.61168440e+01, -1.11684397e+00, -1.22196337e-15]),
- matrix([[-0.23197069, -0.78583024, 0.40824829],
- [-0.52532209, -0.08675134, -0.81649658],
- [-0.8186735 , 0.61232756, 0.40824829]]))
+ In []: linalg.norm(A)
+ Out[]: 10.63014581273465
\end{lstlisting}
-\end{small}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{Single Value Decomposition}
+ \begin{small}
+ \begin{lstlisting}
+In []: linalg.svd(A)
+Out[]:
+(matrix([[-0.13391246, -0.94558684, -0.29653495],
+ [ 0.84641267, -0.26476432, 0.46204486],
+ [-0.51541542, -0.18911737, 0.83581192]]),
+ array([ 7.96445022, 7. , 0.75334767]),
+ matrix([[-0.59703387, 0.79815896, 0.08057807],
+ [-0.64299905, -0.41605821, -0.64299905],
+ [-0.47969029, -0.43570384, 0.7616163 ]]))
+ \end{lstlisting}
+ \end{small}
\end{frame}
\section{Solving linear equations}
@@ -219,7 +276,9 @@ Solution:
\frametitle{Solving using Matrices}
Let us now look at how to solve this using \kwrd{matrices}
\begin{lstlisting}
- In []: A = matrix([[3,2,-1],[2,-2,4],[-1, 0.5, -1]])
+ In []: A = matrix([[3,2,-1],
+ [2,-2,4],
+ [-1, 0.5, -1]])
In []: b = matrix([[1], [-2], [0]])
In []: x = linalg.solve(A, b)
In []: Ax = dot(A, x)
@@ -245,13 +304,24 @@ matrix([[ 1.00000000e+00],
\end{lstlisting}
\end{frame}
+\section{Summary}
\begin{frame}
- \frametitle{Things we have learned}
+ \frametitle{Summary}
+So what did we learn??
\begin{itemize}
- \item
- \item
+ \item Matrices
+ \begin{itemize}
+ \item Transpose
+ \item Addition
+ \item Multiplication
+ \item Inverse of a matrix
+ \item Determinant
+ \item Eigen values and Eigen matrix
+ \item Norms
+ \item Single Value Decomposition
+ \end{itemize}
+ \item Solving linear equations
\end{itemize}
\end{frame}
\end{document}
-