day1/session4.tex
changeset 382 41c34770d63a
parent 379 682b6f66fe11
child 384 9f9fddf7e37c
equal deleted inserted replaced
381:b797cd67982b 382:41c34770d63a
    77 \title[Matrices \& Curve Fitting]{Python for Science and Engg: Matrices \& Least Square Fit}
    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[] {08 March, 2010\\Day 1, Session 4}
    82 \date[] {02 April, 2010\\Day 1, Session 4}
    83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    84 
    84 
    85 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
    85 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
    86 %\logo{\pgfuseimage{iitmlogo}}
    86 %\logo{\pgfuseimage{iitmlogo}}
    87 
    87 
   169 \end{frame}
   169 \end{frame}
   170 
   170 
   171 
   171 
   172 \begin{frame}[fragile]
   172 \begin{frame}[fragile]
   173   \frametitle{Accessing elements}
   173   \frametitle{Accessing elements}
       
   174   \begin{small}
   174   \begin{lstlisting}
   175   \begin{lstlisting}
   175 In []: c
   176 In []: c
   176 Out[]: 
   177 Out[]: 
   177 array([[11, 12, 13],
   178 array([[11, 12, 13],
   178        [21, 22, 23],
   179        [21, 22, 23],
   180 
   181 
   181 In []: c[1][2]
   182 In []: c[1][2]
   182 Out[]: 23
   183 Out[]: 23
   183 In []: c[1,2]
   184 In []: c[1,2]
   184 Out[]: 23
   185 Out[]: 23
   185   \end{lstlisting}
   186 
       
   187 In []: c[1]
       
   188 Out[]: array([21, 22, 23])
       
   189   \end{lstlisting}
       
   190   \end{small}
   186 \end{frame}
   191 \end{frame}
   187 
   192 
   188 \begin{frame}[fragile]
   193 \begin{frame}[fragile]
   189   \frametitle{Changing elements}
   194   \frametitle{Changing elements}
   190   \begin{small}
   195   \begin{small}
   191   \begin{lstlisting}
   196   \begin{lstlisting}
   192 In []: c[1]
       
   193 Out[]: array([21, 22, 23])
       
   194 
       
   195 In []: c[1,1] = -22
   197 In []: c[1,1] = -22
   196 In []: c
   198 In []: c
   197 Out[]: 
   199 Out[]: 
   198 array([[ 11,  12,  13],
   200 array([[ 11,  12,  13],
   199        [ 21, -22,  23],
   201        [ 21, -22,  23],
   392 \end{frame}
   394 \end{frame}
   393 
   395 
   394 \begin{frame}[fragile]
   396 \begin{frame}[fragile]
   395 \frametitle{Inverse of a Matrix}
   397 \frametitle{Inverse of a Matrix}
   396 \begin{lstlisting}
   398 \begin{lstlisting}
       
   399 
       
   400 \end{lstlisting}
       
   401 \begin{small}
       
   402 \begin{lstlisting}
   397 In []: inv(a)
   403 In []: inv(a)
   398 \end{lstlisting}
       
   399 \begin{small}
       
   400 \begin{lstlisting}
       
   401 Out[]: 
   404 Out[]: 
   402 array([[-0.5 ,  0.55, -0.15,  0.7 ],
   405 array([[-0.5 ,  0.55, -0.15,  0.7 ],
   403        [ 0.75, -0.5 ,  0.5 , -0.75],
   406        [ 0.75, -0.5 ,  0.5 , -0.75],
   404        [ 0.5 , -0.15, -0.05, -0.1 ],
   407        [ 0.5 , -0.15, -0.05, -0.1 ],
   405        [ 0.25, -0.25,  0.25, -0.25]])
   408        [ 0.25, -0.25,  0.25, -0.25]])
   406 \end{lstlisting}
   409 \end{lstlisting}
   407 \end{small}
   410 \end{small}
       
   411 \emphbar{Try this: \typ{I = dot(a, inv(a))}}
   408 \end{frame}
   412 \end{frame}
   409 
   413 
   410 \begin{frame}[fragile]
   414 \begin{frame}[fragile]
   411 \frametitle{Determinant and sum of all elements}
   415 \frametitle{Determinant and sum of all elements}
   412 \begin{lstlisting}
   416 \begin{lstlisting}