day1/cheatsheet4.tex
author Santosh G. Vattam <vattam.santosh@gmail.com>
Fri, 06 Nov 2009 18:40:13 +0530
changeset 292 2622aebff64a
parent 284 3c191accbb32
child 295 39d7c4e14585
permissions -rw-r--r--
Branches merged.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
284
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
\documentclass[12pt]{article}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
\title{Matrices and Solution of Equations}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
\author{FOSSEE}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
\begin{document}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     5
\date{}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     6
\vspace{-1in}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     7
\begin{center}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     8
\LARGE{Matrices and Solution of Equations}\\
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     9
\large{FOSSEE}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    10
\end{center}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    11
\section{Matrices}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
Inputting a Matrix
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
\begin{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
In [1]: A = matrix([[1, 2, 3],[4, 5, 6]])
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15
\end{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    16
Matrix Operations
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    17
\begin{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    18
In [1]: A.T # Transpose
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    19
In [2]: sum(A) # Sum of all elements
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    20
In [3]: A+B # Addition
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    21
In [1]: A*B # Product
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    22
In [1]: inv(A) # Inverse
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    23
In [1]: det(A) # Determinant
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    24
\end{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    25
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    26
Eigen Values and Eigen Vectors
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    27
\begin{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    28
In [1]: eig(A) #Eigen Values and Vectors
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    29
In [2]: eigvals(A) #Eigen Values 
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    30
\end{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    31
Norm
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    32
\begin{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    33
In [1]: norm(A)
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    34
\end{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    35
Single Value Decomposition
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    36
\begin{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    37
In [1]: svd(A)
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    38
\end{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    39
Solving a set of equations
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    40
\begin{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    41
In [1]: A = matrix([...]) # Input Equation Coefficient Matrix   
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    42
In [2]: b = matrix([...]) # Equation Target Values
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    43
In [3]: x = solve(A, b)
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    44
In [4]: Ax = A*x
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    45
\end{verbatim}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    46
\end{document}
3c191accbb32 Added Cheatsheets for day1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    47