Download Assignment1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Cross product wikipedia , lookup

System of linear equations wikipedia , lookup

Matrix completion wikipedia , lookup

Capelli's identity wikipedia , lookup

Linear least squares (mathematics) wikipedia , lookup

Rotation matrix wikipedia , lookup

Eigenvalues and eigenvectors wikipedia , lookup

Jordan normal form wikipedia , lookup

Principal component analysis wikipedia , lookup

Matrix (mathematics) wikipedia , lookup

Determinant wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Perron–Frobenius theorem wikipedia , lookup

Four-vector wikipedia , lookup

Non-negative matrix factorization wikipedia , lookup

Gaussian elimination wikipedia , lookup

Orthogonal matrix wikipedia , lookup

Cayley–Hamilton theorem wikipedia , lookup

Matrix calculus wikipedia , lookup

Matrix multiplication wikipedia , lookup

Transcript
Table of Contents
Sl.No
Heading
1)
Basic Mathematical Functions Used in Robotics
2)
Skew Function
3)
Isortho function
4)
Matlab verification script
5)
Verification Session generated by Verification script
Page #
Basic Mathematical Functions Used in Robotics
The following operations are available in Matlab:
+ addition
- subtraction
* multiplication
^ power
' transpose
\ left division
/ right division
Addition(+)
is used to add two matrices of m-by-n size.
(A + B)i,j = Ai,j + Bi,j, where 1 ≤ i ≤ m and 1 ≤ j ≤ n.
Subtraction(-)
is used to subtract two matrices of m-by-n size.
(A - B)i,j = Ai,j - Bi,j, where 1 ≤ i ≤ m and 1 ≤ j ≤ n.
Multiplication(*)
is used to multiply two matrices only if the number of
columns of the left matrix is the same as the number of rows of
the right matrix.
If A is an m-by-n matrix and B is an n-by-p matrix,
then their matrix product AB is the m-by-p matrix whose entries
are given by dot product of the corresponding row of A and the
corresponding column of B:
[AB]i,j= Ai,1B1,j + Ai,2B2,j + ..Ai,nBn,j
Power(^)
Square matrices can be multiplied by themselves repeatedly
in the same way that ordinary numbers can. This repeated
multiplication can be described as a power of the matrix.
Transpose ( ' )
Transpose
of
a
matrix
follows:
T
[A ]ij=[A]
ji
in
mathematical
terms
is
as
The transpose of a matrix is a new matrix whose rows are the
columns of the original matrix. Here is a matrix and its
transpose:
A = [1 2]
A' = [1
2]
Inverse (inv)
Inverse of square matrix is defined as a matrix which
when multiplied by
matrix gives an
identity matrix of same size.
A * A-1 = I
Determinant (det)
Determinant of a matrix calculates the value of a
matrix using the following formula:
and has the value
.
Identity (eye)
the identity matrix or unit matrix of size n is the
n×n square matrix with ones on the main diagonal and zeros
elsewhere. For example:
Eigen(eig)
The below formula is used to find the eigen values of
a given matrix:
P(‫ = )גּ‬det(A -‫ גּ‬In)
Cross product of vectors ( x )
The cross product a × b is defined as a vector c that
is perpendicular to both a and b, with a direction given by the
right-hand rule and a magnitude equal to the area of the
parallelogram that the vectors span.
The cross product is defined by the formula:
where θ is the measure of the smaller angle between a and b (0°
≤ θ ≤ 180°), a and b are the magnitudes of vectors a and b
(i.e., a = |a| and b = |b|), and n is a unit vector
perpendicular to the plane containing a and b in the direction
given by the right-hand rule as illustrated. If the vectors a
and b are parallel (i.e., the angle θ between them is either 0°
or 180°), by the above formula, the cross product of a and b is
the zero vector 0.
The below diagram depicts finding the direction of the cross
product by using “Right hand rule”.
Rand(n)
Y = rand(n) returns an n-by-n matrix of random
entries. An error message appears if n is not a scalar.
skew function (skew(a))
is defined and used in first problem of this
assignment. Given an vector of size 3x1 , it gives the skew
transformation. And also is a square matrix A whose transpose
is also its negative; that is, it satisfies the equation
A = −AT.
SkewA = 0-a3a2 a30-a1 -a2a10
isortho function (isortho(a)) –
given a square matrix this function checks whether it
is orthogonal or not. To check orthogonality we multiply
transpose of matrix to the original matrix. If the resultant
matrix is equal to identity matrix of same size, then matrix is
orthogonal.
If A'A = I ,then A is an orthogonal matrix
Problem 1:
Write matlab function skew(a), which returns a 3x3 skew-symmetric matrix a~ , where a is an arbitrary 3x1
vector.
Problem 2:
Write matlab predicate function isortho(R) which returns true if R is orthogonal matrix, otherwise returns
false.
Problem 3:
Write a matlab script which verifies the following algebraic
identities:
a ×b = skew(a)*b - a and b are arbitrary 3x1 vectors, is cross
product ×
skew(a)' = skew(-a)
det(skew(a)) = 0
skew(a)*a = [0; 0; 0]
skew(a)^2 = a*a' - I*|a|^2 - I is 3x3 identity matrix, |x| is
magnitude of x
skew(a)^3 = -skew(a)*|a|^2
- In the following identities R is a 3x3 proper orthogonal
matrix
skew(R*a) = R*skew(a)*R'
R’ = inv(R)
det(R) = 1
isortho(R) = true
isortho(A) = false - A is an arbitrary non-orthogonal 3x3
matrix