day1/session4.tex
author Puneeth Chaganti <punchagan@fossee.in>
Wed, 04 Nov 2009 10:35:53 +0530
changeset 267 978d06520462
parent 263 8a4a1e5aec85
child 268 f978ddc90960
permissions -rw-r--r--
Added pos_vel_accel file.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     2
%Tutorial slides on Python.
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     3
%
141
fccf675946bf Made usage of FOSSEE consistent; removed all instances of Team, Group.
Puneeth Chaganti <punchagan@fossee.in>
parents: 131
diff changeset
     4
% Author: FOSSEE 
fccf675946bf Made usage of FOSSEE consistent; removed all instances of Team, Group.
Puneeth Chaganti <punchagan@fossee.in>
parents: 131
diff changeset
     5
% Copyright (c) 2009, FOSSEE, IIT Bombay
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     7
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     8
\documentclass[14pt,compress]{beamer}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     9
%\documentclass[draft]{beamer}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    10
%\documentclass[compress,handout]{beamer}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    11
%\usepackage{pgfpages} 
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    12
%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    13
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    14
% Modified from: generic-ornate-15min-45min.de.tex
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    15
\mode<presentation>
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    16
{
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    17
  \usetheme{Warsaw}
239
8953675dc056 Added slide numbers.
Puneeth Chaganti <punchagan@fossee.in>
parents: 235
diff changeset
    18
  \useoutertheme{infolines}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    19
  \setbeamercovered{transparent}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    20
}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    21
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    22
\usepackage[english]{babel}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    23
\usepackage[latin1]{inputenc}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    24
%\usepackage{times}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    25
\usepackage[T1]{fontenc}
123
d2f4053a2e85 Added first slides for ODE.
Puneeth Chaganti <punchagan@fossee.in>
parents: 118
diff changeset
    26
\usepackage{amsmath}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    27
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    28
% Taken from Fernando's slides.
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    29
\usepackage{ae,aecompl}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    30
\usepackage{mathpazo,courier,euler}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    31
\usepackage[scaled=.95]{helvet}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    32
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    33
\definecolor{darkgreen}{rgb}{0,0.5,0}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    34
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    35
\usepackage{listings}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    36
\lstset{language=Python,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    37
    basicstyle=\ttfamily\bfseries,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    38
    commentstyle=\color{red}\itshape,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    39
  stringstyle=\color{darkgreen},
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    40
  showstringspaces=false,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    41
  keywordstyle=\color{blue}\bfseries}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    42
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    43
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    44
% Macros
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    45
\setbeamercolor{emphbar}{bg=blue!20, fg=black}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    46
\newcommand{\emphbar}[1]
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    47
{\begin{beamercolorbox}[rounded=true]{emphbar} 
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    48
      {#1}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    49
 \end{beamercolorbox}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    50
}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    51
\newcounter{time}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    52
\setcounter{time}{0}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    53
\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    54
127
44c2f614e321 Updated Integration section in Session 4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 124
diff changeset
    55
\newcommand{\typ}[1]{\lstinline{#1}}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    56
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    57
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    58
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    59
%%% This is from Fernando's setup.
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    60
% \usepackage{color}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    61
% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    62
% % Use and configure listings package for nicely formatted code
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    63
% \usepackage{listings}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    64
% \lstset{
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    65
%    language=Python,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    66
%    basicstyle=\small\ttfamily,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    67
%    commentstyle=\ttfamily\color{blue},
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    68
%    stringstyle=\ttfamily\color{orange},
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    69
%    showstringspaces=false,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    70
%    breaklines=true,
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    71
%    postbreak = \space\dots
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    72
% }
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    73
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    74
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    75
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    76
% Title page
240
5a96cf81bdc5 Changed titles of Day1 slides.
Puneeth Chaganti <punchagan@fossee.in>
parents: 239
diff changeset
    77
\title[Matrices \& Equations]{Python for Science and Engg: Matrices \& Solution of equations}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    78
141
fccf675946bf Made usage of FOSSEE consistent; removed all instances of Team, Group.
Puneeth Chaganti <punchagan@fossee.in>
parents: 131
diff changeset
    79
\author[FOSSEE] {FOSSEE}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    80
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    81
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    82
\date[] {31, October 2009\\Day 1, Session 4}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    83
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    84
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    85
%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    86
%\logo{\pgfuseimage{iitmlogo}}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    87
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    88
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    89
%% Delete this, if you do not want the table of contents to pop up at
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    90
%% the beginning of each subsection:
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    91
\AtBeginSubsection[]
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    92
{
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    93
  \begin{frame}<beamer>
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    94
    \frametitle{Outline}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    95
    \tableofcontents[currentsection,currentsubsection]
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    96
  \end{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    97
}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    98
213
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
    99
\AtBeginSection[]
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   100
{
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   101
  \begin{frame}<beamer>
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   102
    \frametitle{Outline}
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   103
    \tableofcontents[currentsection,currentsubsection]
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   104
  \end{frame}
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   105
}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   106
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   107
% If you wish to uncover everything in a step-wise fashion, uncomment
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   108
% the following command: 
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   109
%\beamerdefaultoverlayspecification{<+->}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   110
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   111
%\includeonlyframes{current,current1,current2,current3,current4,current5,current6}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   112
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   113
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   114
% DOCUMENT STARTS
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   115
\begin{document}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   116
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   117
\begin{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   118
  \titlepage
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   119
\end{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   120
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   121
\begin{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   122
  \frametitle{Outline}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   123
  \tableofcontents
123
d2f4053a2e85 Added first slides for ODE.
Puneeth Chaganti <punchagan@fossee.in>
parents: 118
diff changeset
   124
%  \pausesections
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   125
\end{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   126
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   127
\section{Matrices}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   128
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   129
\begin{frame}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   130
\frametitle{Matrices: Introduction}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   131
Let us now look at matrices in detail.\\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   132
\alert{All matrix operations are done using \kwrd{arrays}}
179
eea01ca072ff Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 178
diff changeset
   133
\end{frame}
eea01ca072ff Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 178
diff changeset
   134
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   135
\subsection{Initializing}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   136
\begin{frame}[fragile]
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   137
\frametitle{Matrices: Initializing}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   138
\begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   139
In []: A = array([[ 1,  1,  2, -1],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   140
                  [ 2,  5, -1, -9],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   141
                  [ 2,  1, -1,  3],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   142
                  [ 1, -3,  2,  7]])
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   143
In []: A
235
8eab0fee0fc2 Updated session 4 day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 233
diff changeset
   144
Out[]: 
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   145
array([[ 1,  1,  2, -1],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   146
       [ 2,  5, -1, -9],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   147
       [ 2,  1, -1,  3],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   148
       [ 1, -3,  2,  7]])
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   149
\end{lstlisting}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   150
\end{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   151
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   152
\begin{frame}[fragile]
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   153
  \frametitle{Accessing elements of matrices}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   154
\begin{small}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   155
  \begin{lstlisting}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   156
In []: C = array([[1,1,2],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   157
                  [2,4,1],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   158
                  [-1,3,7]])
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   159
In []: C[1,2]
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   160
Out[]: 1
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   161
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   162
In []: C[1]
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   163
Out[]: array([2, 4, 1])
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   164
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   165
In []: C[1,1] = -2
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   166
In []: C
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   167
Out[]: 
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   168
array([[ 1,  1,  2],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   169
       [ 2, -2,  1],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   170
       [-1,  3,  7]])
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   171
  \end{lstlisting}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   172
\end{small}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   173
\end{frame}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   174
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   175
\subsection{Basic Operations}
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   176
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   177
\begin{frame}[fragile]
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   178
\frametitle{Transpose of a Matrix}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   179
\begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   180
In []: A.T
235
8eab0fee0fc2 Updated session 4 day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 233
diff changeset
   181
Out[]:
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   182
array([[ 1,  2,  2,  1],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   183
       [ 1,  5,  1, -3],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   184
       [ 2, -1, -1,  2],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   185
       [-1, -9,  3,  7]])
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   186
\end{lstlisting}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   187
\end{frame}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   188
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   189
\begin{frame}[fragile]
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   190
  \frametitle{Sum of all elements}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   191
  \begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   192
In []: sum(A)
235
8eab0fee0fc2 Updated session 4 day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 233
diff changeset
   193
Out[]: 12
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   194
  \end{lstlisting}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   195
\end{frame}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   196
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   197
\begin{frame}[fragile]
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   198
  \frametitle{Matrix Addition}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   199
  \begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   200
In []: B = array([[3,2,-1,5],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   201
                  [2,-2,4,9],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   202
                  [-1,0.5,-1,-7],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   203
                  [9,-5,7,3]])
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   204
In []: A + B
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   205
Out[]: 
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   206
array([[  4. ,   3. ,   1. ,   4. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   207
       [  4. ,   3. ,   3. ,   0. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   208
       [  1. ,   1.5,  -2. ,  -4. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   209
       [ 10. ,  -8. ,   9. ,  10. ]])
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   210
  \end{lstlisting}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   211
\end{frame}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   212
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   213
\begin{frame}[fragile]
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   214
\frametitle{Elementwise Multiplication}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   215
\begin{lstlisting}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   216
In []: A*B
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   217
Out[]: 
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   218
array([[  3. ,   2. ,  -2. ,  -5. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   219
       [  4. , -10. ,  -4. , -81. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   220
       [ -2. ,   0.5,   1. , -21. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   221
       [  9. ,  15. ,  14. ,  21. ]])
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   222
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   223
\end{lstlisting}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   224
\end{frame}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   225
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   226
\begin{frame}[fragile]
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   227
\frametitle{Matrix Multiplication}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   228
\begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   229
In []: dot(A,B)
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   230
Out[]: 
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   231
array([[ -6. ,   6. ,  -6. ,  -3. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   232
       [-64. ,  38.5, -44. ,  35. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   233
       [ 36. , -13.5,  24. ,  35. ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   234
       [ 58. , -26. ,  34. , -15. ]])
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   235
\end{lstlisting}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   236
\end{frame}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   237
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   238
\begin{frame}[fragile]
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   239
\frametitle{Inverse of a Matrix}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   240
\begin{lstlisting}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   241
In []: inv(A)
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   242
\end{lstlisting}
131
b3a78754c4a9 Minor edits to day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 127
diff changeset
   243
\begin{small}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   244
\begin{lstlisting}
179
eea01ca072ff Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 178
diff changeset
   245
Out[]: 
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   246
array([[-0.5 ,  0.55, -0.15,  0.7 ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   247
       [ 0.75, -0.5 ,  0.5 , -0.75],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   248
       [ 0.5 , -0.15, -0.05, -0.1 ],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   249
       [ 0.25, -0.25,  0.25, -0.25]])
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   250
\end{lstlisting}
131
b3a78754c4a9 Minor edits to day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 127
diff changeset
   251
\end{small}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   252
\end{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   253
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   254
\begin{frame}[fragile]
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   255
\frametitle{Determinant}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   256
\begin{lstlisting}
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   257
In []: det(A)
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   258
Out[]: 80.0
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   259
\end{lstlisting}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   260
\end{frame}
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   261
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   262
%%use S=array(X,Y)
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   263
\begin{frame}[fragile]
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   264
\frametitle{Eigenvalues and Eigen Vectors}
131
b3a78754c4a9 Minor edits to day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 127
diff changeset
   265
\begin{small}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   266
\begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   267
In []: E = array([[3,2,4],[2,0,2],[4,2,3]])
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   268
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   269
In []: eig(E)
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   270
Out[]: 
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   271
(array([-1.,  8., -1.]),
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   272
 array([[-0.74535599,  0.66666667, -0.1931126 ],
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   273
        [ 0.2981424 ,  0.33333333, -0.78664085],
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   274
        [ 0.59628479,  0.66666667,  0.58643303]]))
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   275
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   276
In []: eigvals(E)
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   277
Out[]: array([-1.,  8., -1.])
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   278
\end{lstlisting}
131
b3a78754c4a9 Minor edits to day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 127
diff changeset
   279
\end{small}
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   280
\end{frame}
127
44c2f614e321 Updated Integration section in Session 4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 124
diff changeset
   281
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   282
\begin{frame}[fragile]
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   283
\frametitle{Computing Norms}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   284
\begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   285
In []: norm(E)
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   286
Out[]: 8.1240384046359608
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   287
\end{lstlisting}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   288
\end{frame}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   289
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   290
\begin{frame}[fragile]
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   291
  \frametitle{Singular Value Decomposition}
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   292
  \begin{small}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   293
  \begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   294
In []: svd(E)
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   295
Out[]: 
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   296
(array(
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   297
[[ -6.66666667e-01,  -1.23702565e-16,   7.45355992e-01],
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   298
 [ -3.33333333e-01,  -8.94427191e-01,  -2.98142397e-01],
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   299
 [ -6.66666667e-01,   4.47213595e-01,  -5.96284794e-01]]),
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   300
 array([ 8.,  1.,  1.]),
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   301
 array([[-0.66666667, -0.33333333, -0.66666667],
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   302
        [-0.        ,  0.89442719, -0.4472136 ],
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   303
        [-0.74535599,  0.2981424 ,  0.59628479]]))
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   304
  \end{lstlisting}
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   305
  \end{small}
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   306
\inctime{15}
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   307
\end{frame}
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   308
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   309
\section{Solving linear equations}
172
72bd110ab42f Moved quadrature section; Added a section on functions; day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 141
diff changeset
   310
72bd110ab42f Moved quadrature section; Added a section on functions; day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 141
diff changeset
   311
\begin{frame}[fragile]
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   312
\frametitle{Solution of equations}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   313
Consider,
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   314
  \begin{align*}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   315
    3x + 2y - z  & = 1 \\
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   316
    2x - 2y + 4z  & = -2 \\
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   317
    -x + \frac{1}{2}y -z & = 0
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   318
  \end{align*}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   319
Solution:
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   320
  \begin{align*}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   321
    x & = 1 \\
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   322
    y & = -2 \\
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   323
    z & = -2
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   324
  \end{align*}
178
8a3a9d98fa84 Changed functions section and some minor edits.
Puneeth Chaganti <punchagan@fossee.in>
parents: 172
diff changeset
   325
\end{frame}
8a3a9d98fa84 Changed functions section and some minor edits.
Puneeth Chaganti <punchagan@fossee.in>
parents: 172
diff changeset
   326
8a3a9d98fa84 Changed functions section and some minor edits.
Puneeth Chaganti <punchagan@fossee.in>
parents: 172
diff changeset
   327
\begin{frame}[fragile]
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   328
\frametitle{Solving using Matrices}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   329
Let us now look at how to solve this using \kwrd{matrices}
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   330
  \begin{lstlisting}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   331
    In []: A = array([[3,2,-1],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   332
                      [2,-2,4],                   
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   333
                      [-1, 0.5, -1]])
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   334
    In []: b = array([[1], [-2], [0]])
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   335
    In []: x = solve(A, b)
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   336
    In []: Ax = dot(A,x)
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   337
  \end{lstlisting}
172
72bd110ab42f Moved quadrature section; Added a section on functions; day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 141
diff changeset
   338
\end{frame}
72bd110ab42f Moved quadrature section; Added a section on functions; day1 session4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 141
diff changeset
   339
178
8a3a9d98fa84 Changed functions section and some minor edits.
Puneeth Chaganti <punchagan@fossee.in>
parents: 172
diff changeset
   340
\begin{frame}[fragile]
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   341
\frametitle{Solution:}
178
8a3a9d98fa84 Changed functions section and some minor edits.
Puneeth Chaganti <punchagan@fossee.in>
parents: 172
diff changeset
   342
\begin{lstlisting}
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   343
In []: x
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   344
Out[]: 
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   345
array([[ 1.],
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   346
       [-2.],
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   347
       [-2.]])
232
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   348
\end{lstlisting}
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   349
\end{frame}
127
44c2f614e321 Updated Integration section in Session 4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 124
diff changeset
   350
232
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   351
\begin{frame}[fragile]
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   352
\frametitle{Let's check!}
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   353
\begin{lstlisting}
197
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   354
In []: Ax
8c42ffdaaeec Updated session 4 slides based on review.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 185
diff changeset
   355
Out[]: 
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   356
array([[  1.00000000e+00],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   357
       [ -2.00000000e+00],
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   358
       [  2.22044605e-16]])
127
44c2f614e321 Updated Integration section in Session 4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 124
diff changeset
   359
\end{lstlisting}
232
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   360
\begin{block}{}
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   361
The last term in the matrix is actually \alert{0}!\\
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   362
We can use \kwrd{allclose()} to check.
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   363
\end{block}
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   364
\begin{lstlisting}
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   365
In []: allclose(Ax, b)
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   366
Out[]: True
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   367
\end{lstlisting}
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   368
\inctime{15}
232
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   369
\end{frame}
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   370
233
c435d5846ef5 Updated Session 4 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 232
diff changeset
   371
\subsection{Exercises}
235
8eab0fee0fc2 Updated session 4 day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 233
diff changeset
   372
232
b9748af050c4 Updated the session 4, day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 214
diff changeset
   373
\begin{frame}[fragile]
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   374
\frametitle{Problem 1}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   375
Given the matrix:\\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   376
\begin{center}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   377
$\begin{bmatrix}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   378
-2 & 2 & 3\\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   379
 2 & 1 & 6\\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   380
-1 &-2 & 0\\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   381
\end{bmatrix}$
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   382
\end{center}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   383
Find:
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   384
\begin{itemize}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   385
  \item[i] Transpose
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   386
  \item[ii]Inverse
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   387
  \item[iii]Determinant
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   388
  \item[iv] Eigenvalues and Eigen vectors
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   389
  \item[v] Singular Value decomposition
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   390
\end{itemize}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   391
\end{frame}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   392
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   393
\begin{frame}[fragile]
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   394
\frametitle{Problem 2}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   395
Given 
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   396
\begin{center}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   397
A = 
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   398
$\begin{bmatrix}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   399
-3 & 1 & 5 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   400
1 & 0 & -2 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   401
5 & -2 & 4 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   402
\end{bmatrix}$
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   403
, B = 
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   404
$\begin{bmatrix}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   405
0 & 9 & -12 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   406
-9 & 0 & 20 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   407
12 & -20 & 0 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   408
\end{bmatrix}$
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   409
\end{center}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   410
Find:
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   411
\begin{itemize}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   412
  \item[i] Sum of A and B
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   413
  \item[ii]Elementwise Product of A and B
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   414
  \item[iii] Matrix product of A and B
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   415
\end{itemize}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   416
\end{frame}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   417
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   418
\begin{frame}[fragile]
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   419
\frametitle{Solution}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   420
Sum: 
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   421
$\begin{bmatrix}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   422
-3 & 10 & 7 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   423
-8 & 0 & 18 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   424
17 & -22 & 4 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   425
\end{bmatrix}$
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   426
,\\ Elementwise Product:
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   427
$\begin{bmatrix}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   428
0 & 9 & -60 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   429
-9 & 0 & -40 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   430
60 & 40 & 0 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   431
\end{bmatrix}$
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   432
,\\ Matrix product:
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   433
$\begin{bmatrix}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   434
51 & -127 & 56 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   435
-24 & 49 & -12 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   436
66 & -35 & -100 \\
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   437
\end{bmatrix}$
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   438
\end{frame}
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   439
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   440
\begin{frame}[fragile]
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   441
\frametitle{Problem 3}
235
8eab0fee0fc2 Updated session 4 day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 233
diff changeset
   442
Solve the set of equations:
233
c435d5846ef5 Updated Session 4 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 232
diff changeset
   443
\begin{align*}
c435d5846ef5 Updated Session 4 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 232
diff changeset
   444
  x + y + 2z -w & = 3\\
c435d5846ef5 Updated Session 4 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 232
diff changeset
   445
  2x + 5y - z - 9w & = -3\\
c435d5846ef5 Updated Session 4 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 232
diff changeset
   446
  2x + y -z + 3w & = -11 \\
c435d5846ef5 Updated Session 4 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 232
diff changeset
   447
  x - 3y + 2z + 7w & = -5\\
c435d5846ef5 Updated Session 4 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 232
diff changeset
   448
\end{align*}
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   449
\inctime{10}
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   450
\end{frame}
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   451
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   452
\begin{frame}[fragile]
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   453
\frametitle{Solution}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   454
Use \kwrd{solve()}
253
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   455
\begin{align*}
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   456
  x & = -5\\
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   457
  y & = 2\\
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   458
  z & = 3\\
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   459
  w & = 0\\
e446ed7287d7 Updated session 2 and session 4 slides of day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 240
diff changeset
   460
\end{align*}
127
44c2f614e321 Updated Integration section in Session 4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 124
diff changeset
   461
\end{frame}
44c2f614e321 Updated Integration section in Session 4.
Puneeth Chaganti <punchagan@fossee.in>
parents: 124
diff changeset
   462
213
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   463
\section{Summary}
185
e59ab9ab1a89 Manual Merge with Mainline.
Puneeth Chaganti <punchagan@fossee.in>
parents: 179
diff changeset
   464
\begin{frame}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   465
  \frametitle{What did we learn??}
185
e59ab9ab1a89 Manual Merge with Mainline.
Puneeth Chaganti <punchagan@fossee.in>
parents: 179
diff changeset
   466
  \begin{itemize}
213
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   467
  \item Matrices
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   468
    \begin{itemize}
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   469
      \item Accessing elements
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   470
      \item Transpose
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   471
      \item Addition
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   472
      \item Multiplication
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   473
      \item Inverse of a matrix
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   474
      \item Determinant
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   475
      \item Eigenvalues and Eigen vector
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   476
      \item Norms
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 253
diff changeset
   477
      \item Singular Value Decomposition
214
19592f802dde Added matrix operations.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 213
diff changeset
   478
    \end{itemize}
213
ce62706cf870 Resolved conflicts manually.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 203
diff changeset
   479
  \item Solving linear equations
185
e59ab9ab1a89 Manual Merge with Mainline.
Puneeth Chaganti <punchagan@fossee.in>
parents: 179
diff changeset
   480
  \end{itemize}
e59ab9ab1a89 Manual Merge with Mainline.
Puneeth Chaganti <punchagan@fossee.in>
parents: 179
diff changeset
   481
\end{frame}
e59ab9ab1a89 Manual Merge with Mainline.
Puneeth Chaganti <punchagan@fossee.in>
parents: 179
diff changeset
   482
118
c7f85ba59af3 Added session4.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   483
\end{document}