equal
deleted
inserted
replaced
|
1 \documentclass[12pt]{article} |
|
2 \title{Matrices and Solution of Equations} |
|
3 \author{FOSSEE} |
|
4 \begin{document} |
|
5 \date{} |
|
6 \vspace{-1in} |
|
7 \begin{center} |
|
8 \LARGE{Matrices and Solution of Equations}\\ |
|
9 \large{FOSSEE} |
|
10 \end{center} |
|
11 \section{Matrices} |
|
12 Inputting a Matrix |
|
13 \begin{verbatim} |
|
14 In [1]: A = matrix([[1, 2, 3],[4, 5, 6]]) |
|
15 \end{verbatim} |
|
16 Matrix Operations |
|
17 \begin{verbatim} |
|
18 In [1]: A.T # Transpose |
|
19 In [2]: sum(A) # Sum of all elements |
|
20 In [3]: A+B # Addition |
|
21 In [1]: A*B # Product |
|
22 In [1]: inv(A) # Inverse |
|
23 In [1]: det(A) # Determinant |
|
24 \end{verbatim} |
|
25 |
|
26 Eigen Values and Eigen Vectors |
|
27 \begin{verbatim} |
|
28 In [1]: eig(A) #Eigen Values and Vectors |
|
29 In [2]: eigvals(A) #Eigen Values |
|
30 \end{verbatim} |
|
31 Norm |
|
32 \begin{verbatim} |
|
33 In [1]: norm(A) |
|
34 \end{verbatim} |
|
35 Single Value Decomposition |
|
36 \begin{verbatim} |
|
37 In [1]: svd(A) |
|
38 \end{verbatim} |
|
39 Solving a set of equations |
|
40 \begin{verbatim} |
|
41 In [1]: A = matrix([...]) # Input Equation Coefficient Matrix |
|
42 In [2]: b = matrix([...]) # Equation Target Values |
|
43 In [3]: x = solve(A, b) |
|
44 In [4]: Ax = A*x |
|
45 \end{verbatim} |
|
46 \end{document} |
|
47 |