diff options
author | Puneeth Chaganti | 2009-10-15 23:10:03 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2009-10-15 23:10:03 +0530 |
commit | 6e81ab382c4593dd33391596049a5fb5446f500e (patch) | |
tree | cd209be9386bb188579cc074ed5928aad82e2c3d /day1 | |
parent | 2a6f12be94f3361944842338bbfb59c44559e45e (diff) | |
download | workshops-more-scipy-6e81ab382c4593dd33391596049a5fb5446f500e.tar.gz workshops-more-scipy-6e81ab382c4593dd33391596049a5fb5446f500e.tar.bz2 workshops-more-scipy-6e81ab382c4593dd33391596049a5fb5446f500e.zip |
Minor edits to day1 session4.
Diffstat (limited to 'day1')
-rw-r--r-- | day1/session3.tex | 34 | ||||
-rw-r--r-- | day1/session4.tex | 13 |
2 files changed, 14 insertions, 33 deletions
diff --git a/day1/session3.tex b/day1/session3.tex index 2b4eb9e..7168f72 100644 --- a/day1/session3.tex +++ b/day1/session3.tex @@ -78,7 +78,7 @@ \author[FOSSEE] {FOSSEE} \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} -\date[] {31, October 2009} +\date[] {31, October 2009\\Day 1, Session 3} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} @@ -230,7 +230,7 @@ In []: A=vander(L,2) \end{enumerate} \end{itemize} \begin{lstlisting} -coeffs, res, rank, sing = lstsq(A,Tsq) +In []: coef, res, r, s = lstsq(A,Tsq) \end{lstlisting} \end{frame} @@ -239,15 +239,15 @@ coeffs, res, rank, sing = lstsq(A,Tsq) \begin{itemize} \item Use the poly1d function of pylab, to create a function for the line equation using the coefficients obtained \begin{lstlisting} -p=poly1d(coeffs) +In []: p=poly1d(coef) \end{lstlisting} \item Get new $T^2$ values using the function \typ{p} obtained \begin{lstlisting} -Tline = p(L) +In []: Tline = p(L) \end{lstlisting} \item Now plot Tline vs. L, to get the Least squares fit line. \begin{lstlisting} -plot(L, Tline) +In []: plot(L, Tline) \end{lstlisting} \end{itemize} \end{frame} @@ -417,27 +417,3 @@ for k in data: \end{document} -Least squares: Smooth curve fit. -Array Operations: Mean, average (etc region wise like district wise and state wise from SSLC.txt) -Subject wise average. Introduce idea of dictionary. - -Session 3 - -import scipy -from scipy import linalg. - -choose some meaningful plot. ?? -Newton's law of cooling. -u, v, f - optics -hooke's law -Least fit curves. - - -Choose a named problem. -ODE - first order. Whatever. - - -arrays, etc etc. -sum, average, mean. whatever. statistical -sslc data -numpy load text?? diff --git a/day1/session4.tex b/day1/session4.tex index eec7e85..08f4242 100644 --- a/day1/session4.tex +++ b/day1/session4.tex @@ -129,7 +129,9 @@ \begin{frame}[fragile] \frametitle{Matrices: Initializing} \begin{lstlisting} - In []: a = matrix([[1,2,3],[4,5,6],[7,8,9]]) + In []: a = matrix([[1,2,3], + [4,5,6], + [7,8,9]]) In []: a Out[]: @@ -142,6 +144,7 @@ \subsection{Basic Operations} \begin{frame}[fragile] \frametitle{Inverse of a Matrix} +\begin{small} \begin{lstlisting} In []: linalg.inv(a) Out[]: @@ -149,6 +152,7 @@ [ -6.30442381e+15, 1.26088476e+16, -6.30442381e+15], [ 3.15221191e+15, -6.30442381e+15, 3.15221191e+15]]) \end{lstlisting} +\end{small} \end{frame} \begin{frame}[fragile] @@ -164,13 +168,12 @@ \begin{lstlisting} In []: linalg.norm(a) Out[]: 16.881943016134134 - - In []: linalg.norm? \end{lstlisting} \end{frame} \begin{frame}[fragile] \frametitle{Eigen Values and Eigen Matrix} +\begin{small} \begin{lstlisting} In []: linalg.eigvals(a) Out[]: array([ 1.61168440e+01, -1.11684397e+00, -1.22196337e-15]) @@ -182,18 +185,20 @@ [-0.52532209, -0.08675134, -0.81649658], [-0.8186735 , 0.61232756, 0.40824829]])) \end{lstlisting} +\end{small} \end{frame} \section{Solving linear equations} \begin{frame}[fragile] \frametitle{Solution of equations} Example problem: Consider the set of equations +\vspace{-0.1in} \begin{align*} 3x + 2y - z & = 1 \\ 2x - 2y + 4z & = -2 \\ -x + \frac{1}{2}y -z & = 0 \end{align*} - +\vspace{-0.08in} To Solve this, \begin{lstlisting} In []: A = array([[3,2,-1],[2,-2,4],[-1, 0.5, -1]]) |