vectors and matrices

25
Vectors and Matrices Class 17.1 E: Ch. 5

Upload: kenaz

Post on 09-Jan-2016

41 views

Category:

Documents


3 download

DESCRIPTION

Vectors and Matrices. Class 17.1 E: Ch. 5. Objectives. Know what a Cartesian coordinate system is. Know the difference between a scalar and a vector. Review/learn how to interpret, add, subtract, and find the magnitude of vectors Know how to use the right hand rule. Objectives. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Vectors and Matrices

Vectors and Matrices

Class 17.1E: Ch. 5

Page 2: Vectors and Matrices

Objectives

Know what a Cartesian coordinate system is.Know the difference between a scalar and a vector.Review/learn how to interpret, add, subtract, and find the magnitude of vectors Know how to use the right hand rule.

Page 3: Vectors and Matrices

Objectives

Be able to calculate the determinant of a matrix.Be able to calculate the dot and cross products of vectorsBe able to represent a system of linear equations as matrices and vectors.Be able to solve systems of linear equations using matrices.

Page 4: Vectors and Matrices

4

Cartesian Coordinates

The Cartesian coordinate system is a system of orthogonal axes which is the basis for describing body and force systems in mechanics. The coordinate system is

always right handed (obeysthe right hand rule.

We will focus on 2D systems.

x

y

z

Page 5: Vectors and Matrices

5

Scalars and Vectors

A scalar is a physical quantity having magnitude but not direction Length, mass, time

A vector is a physical quantity having both magnitude and direction Force, velocity, acceleration

Page 6: Vectors and Matrices

6

Vectors

Vectors have components along axes of the Cartesian system x, y, and z axes are denoted by unit vectors

carat often used to imply unit vectorUnit vectors have a magnitude (length) of

one.

kji ˆ,ˆ,ˆ

x

y

z

ij

k P kcjbiaP ˆˆˆ

a

b

c

Page 7: Vectors and Matrices

7

Vectors

Consider the 2D vectormagnitude (length)

angle w/ horizontal

jbiax ˆˆ

22 bax

x

b

hyp

oppx

a

hyp

adja

b

a

b

adj

opp

sin

cos

tantan 1

54321-1

4

3

2

1

00

-1

-2

j

jix ˆ3ˆ4

i

rad 644.087.36tan

534

431

22

x

Page 8: Vectors and Matrices

Dot Product

Dot product is a vector operation. Dot product of matrices does not exist.

The result is a scalar.

Using tools: TI-83,86: dot TI-89: dotp Maple: dotprod Matlab: dot

32)3(6)5(2)4(1654ˆ6ˆ5ˆ4

321ˆ3ˆ21

bakjib

kjia

Page 9: Vectors and Matrices

Dot Product:

Consider the 2D case:

Plot these vectors.

3233

31ˆ31

13ˆ1ˆ3

ba

jib

jia

30cos

231

21322

22

abab baba

b

a

abcosbaba

Page 10: Vectors and Matrices

10

Vector Addition & SubtractionWhen adding, treat each direction separately

To add, place vectors head to tailThe negative of a vector is simply pointing in the opposite directionThe sum of vectors is called the resultant.

jbbiaaxx

jbiaxjbiax

ˆˆ

ˆˆ and ˆˆ

212121

222111

54321-1

4

3

2

1

00

-1

-2

j

1x

i

2x

1x

2x

21 xx

21 xx

Page 11: Vectors and Matrices

11

Matrix and Vector

A matrix is an n x m array of numbers n rows, m columns The ij-th element, aij, is the element in row i

and column j

A vector is a matrix that has only one row or only one column

nmnn

m

m

aaa

aaa

aaa

21

22221

11211

A

Page 12: Vectors and Matrices

12

Basic Functions

The transpose is obtained by swapping columns and rows In Matlab: apostrophe

The addition operation requires dimensional agreement. i.e. to add a m x n matrix and a q x r matrix,

must have m = q and n = r

Matrix addition is done by corresponding element

Page 13: Vectors and Matrices

13

Matrix Multiplication

Matrix multiplication requires inner-dimensional agreement i.e. to multiply a m x n matrix and a q x r

matrix, must have n = q

Matrix multiplication is done by summing elementwise multiplication of row i in the first matrix with column j of the second matrix to get the ij-th element of the product.

Page 14: Vectors and Matrices

14

Matrix Multiplication

mjimij

pm

pm

nmnn

m

pqpp

q

q

nmnn

m

m

bac

bababac

bababac

pm

ccc

cc

bbb

bbb

bbb

aaa

aaa

aaa

212212121112

112112111111

21

111

21

22221

11211

21

22221

11211

*

Page 15: Vectors and Matrices

Determinant

The determinant operation applies to a square matrix (# rows = # columns) Denoted with bars 2x2 case:

21122211

2221

1211

2221

1211

)det(

aaaaaa

aaAA

aa

aaA

Page 16: Vectors and Matrices

Determinant

For the 3x3 case:

1863

427

93

825

96

841

963

842

751

)det(

963

842

751

)det(

AA

hg

edc

kg

fdb

kh

fea

khg

fed

cba

c

khg

fed

cba

b

khg

fed

cba

aA

khg

fed

cba

A

alternatesign

Page 17: Vectors and Matrices

Determinant

For higher order cases uses tools. TI-86,89: det Maple:

> with(linalg);

> det([[1,5,7],[2,4,8],[3,6,9]]); Matlab: det

Page 18: Vectors and Matrices

Cross Product

The cross product is a vector operation yields a vector according to the right-hand-

rule

Also have:

kji

kji

kji

ba

kjib

kjia

ˆ3ˆ6ˆ3

54

21ˆ64

31ˆ65

32ˆ

654

321

ˆˆˆ654ˆ6ˆ5ˆ4

321ˆ3ˆ21

absinbaba

Page 19: Vectors and Matrices

Cross Product

Example:

Using your tools. TI-89: crossp([1,5,7],[2,4,8]) Maple:

> with(linalg);

> crossprod([[1,5,7],[2,4,8]); Matlab: cross([1 5 7],[2 4 8])

kjiba

kjib

kjia

ˆ6ˆ6ˆ12

842ˆ8ˆ4ˆ2

751ˆ7ˆ51

Page 20: Vectors and Matrices

Inverse

A matrix times its inverse equals the identity matrix Identity: All elements on the main diagonal

are 1, all others are 0; matrix version of the scalar 1.

Matrix division is undefinedUsing TI-89: ([[1,5,7][2,4,8][3,6,9]])^-1Matlab: inv([1,5,7; 2,4,8; 3,6,9]);Using Maple: inverse([[1,5,7],[2,4,8],[3,6,9]]);

-2

3

-1

6

2

3

1

3

-2

3

1

3

01

2

-1

3

A-1 =

Page 21: Vectors and Matrices

Linear Equations

A linear equation is of the form:

where the ai’s are constants (coefficients)In order to solve for n unknowns (xn), n independent equations are needed.

bxaxaxaxa nn 332211

Page 22: Vectors and Matrices

2 Equations, 2 Unknowns

Consider the system of equations:

3 things can happen: Exactly one solution (lines intersect)

independent No solution (lines are parallel) Infinite number of solutions (same line)

222

111

cybxacybxa

Page 23: Vectors and Matrices

Solving Systems of Equations

Consider a system of 3 eqns, 3 unknowns:

This can be written as:

Using inverses can only be used if there is a single, unique solution; If multiple or no solutions exist, the inverse does not exist

124342

12442

zyxzyxzyx

bAxbAx

bxA

1

1

4

12

243

121

442

z

y

x

1

1

2

2

x =

Page 24: Vectors and Matrices

Solving Systems of Equations

Using your tools:Using Maple:multiply(inverse([[2,4,4],[1,2,1],[3,4,-2]]),[[12],[4],[1]]);

Using TI-89(([[1,5,7],[2,4,8],[3,6,9]])^-1)*([12;4;1])Or use ‘solve’Using Matlab:inv ([2,4,4; 1,2,1; 3,4,-2])*[12; 4; 1]);

Page 25: Vectors and Matrices

Homework

WebAssignYour documentation of your homework is 20% of your webassign assignment grade. Homework documentation is due at the beginning of class when the webassign homework is due. If webassign is not due at the beginning of a class, your documentation is due at the beginning of the immediate next class or lab.If you need a refresher on problem presentation, read Ch. 2 in Eide