day1/session4.tex
changeset 285 e072cadee389
parent 282 b2dafce03b8d
child 286 ac457f7d1702
equal deleted inserted replaced
284:3c191accbb32 285:e072cadee389
    72 % }
    72 % }
    73 
    73 
    74 
    74 
    75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    76 % Title page
    76 % Title page
    77 \title[Matrices \& Equations]{Python for Science and Engg: Matrices, Least Square Fit, \& Solution of equations}
    77 \title[Matrices \& Curve Fitting]{Python for Science and Engg: Matrices \& Least Square Fit}
    78 
    78 
    79 \author[FOSSEE] {FOSSEE}
    79 \author[FOSSEE] {FOSSEE}
    80 
    80 
    81 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
    81 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
    82 \date[] {31 October, 2009\\Day 1, Session 4}
    82 \date[] {31 October, 2009\\Day 1, Session 4}
   275   \item Resize image to half by dropping alternate pixels
   275   \item Resize image to half by dropping alternate pixels
   276   \end{itemize}
   276   \end{itemize}
   277 \end{frame}
   277 \end{frame}
   278 
   278 
   279 \begin{frame}[fragile]
   279 \begin{frame}[fragile]
   280   \frametitle{Slicing \& Striding Exercises \ldots}
   280   \frametitle{Solutions}
   281 \begin{small}
   281 \begin{small}
   282   \begin{lstlisting}
   282   \begin{lstlisting}
   283 In []: imshow(A[:256,:256])
   283 In []: imshow(A[:256,:256])
   284 Out[]: <matplotlib.image.AxesImage object at 0xb6f658c>
   284 Out[]: <matplotlib.image.AxesImage object at 0xb6f658c>
   285 
   285 
   460 
   460 
   461 \begin{frame}[fragile]
   461 \begin{frame}[fragile]
   462 \frametitle{\typ{lstsq}}
   462 \frametitle{\typ{lstsq}}
   463 \begin{itemize}
   463 \begin{itemize}
   464 \item We need to fit a line through points for the equation $T^2 = m \cdot L+c$
   464 \item We need to fit a line through points for the equation $T^2 = m \cdot L+c$
   465 \item The equation can be re-written as $T^2 = A \cdot p$
   465 \item In matrix form, the equation can be represented as $T^2 = A \cdot p$, where A is   
   466 \item where A is   
       
   467   $\begin{bmatrix}
   466   $\begin{bmatrix}
   468   L_1 & 1 \\
   467   L_1 & 1 \\
   469   L_2 & 1 \\
   468   L_2 & 1 \\
   470   \vdots & \vdots\\
   469   \vdots & \vdots\\
   471   L_N & 1 \\
   470   L_N & 1 \\
   534 \begin{lstlisting}
   533 \begin{lstlisting}
   535 In []: plot(L, Tline)
   534 In []: plot(L, Tline)
   536 \end{lstlisting}
   535 \end{lstlisting}
   537 \end{frame}
   536 \end{frame}
   538 
   537 
       
   538 \begin{frame}[fragile]
       
   539 \frametitle{Least Squares Fit}
       
   540 \vspace{-0.15in}
       
   541 \begin{figure}
       
   542 \includegraphics[width=4in]{data/least-sq-fit}
       
   543 \end{figure}
       
   544 \end{frame}
       
   545 
   539 \section{Summary}
   546 \section{Summary}
   540 \begin{frame}
   547 \begin{frame}
   541   \frametitle{What did we learn??}
   548   \frametitle{What did we learn?}
   542   \begin{itemize}
   549   \begin{itemize}
   543   \item Matrices
   550   \item Matrices
   544     \begin{itemize}
   551     \begin{itemize}
   545       \item Accessing elements
   552       \item Accessing elements
       
   553       \item Slicing and Striding
   546       \item Transpose
   554       \item Transpose
   547       \item Addition
   555       \item Addition
   548       \item Multiplication
   556       \item Multiplication
   549       \item Inverse of a matrix
   557       \item Inverse of a matrix
   550       \item Determinant
   558       \item Determinant