28
r 3: Linear Algebra r 3: Linear Algebra lving sets of linear equations lve for x, y, z. + 5y + 2z = -4 + 9z = 12 4y + 2z = 3 an solve longhand) (can solve same problem using matrix algebra tricks) as- see transparency. More commonly: 3 5 2 4 2 0 9 12 0 4 2 3 x y z 3 5 2 4 2 0 9 12 0 4 2 3

Chapter 3: Linear Algebra I. Solving sets of linear equations ex: solve for x, y, z

  • Upload
    indiya

  • View
    27

  • Download
    3

Embed Size (px)

DESCRIPTION

Chapter 3: Linear Algebra I. Solving sets of linear equations ex: solve for x, y, z. 3x + 5y + 2z = -4 2x + 9z = 12 4y + 2z = 3 (can solve longhand) (can solve same problem using matrix algebra tricks) ex: Boas- see transparency. More commonly:. - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

Chapter 3: Linear AlgebraChapter 3: Linear Algebra

I. Solving sets of linear equations

ex: solve for x, y, z.

3x + 5y + 2z = -4

2x + 9z = 12

4y + 2z = 3

(can solve longhand) (can solve same problem

using matrix algebra tricks)

ex: Boas- see transparency.

More commonly:

3 5 2 4

2 0 9 12

0 4 2 3

x

y

z

3 5 2 4

2 0 9 12

0 4 2 3

Page 2: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

Allowed Moves: “Row operations”

1) Exchanging two rows (not columns!)2) Multiply or divide a row by a nonzero constant.3) Add or subtract one row from another.

ex: Pre-class assignment

ex: Circuit- see transparency and pg. 2

Page 3: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: Circuit: Find i1, i2, i3.(Halliday and Resnick, Ch. 28, 33P)

Page 4: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: Circuit (continued)

Page 5: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

II. Determinants(only works for square matrices)

Notation:

We can extract much useful information from a matrix by boiling it down to one number called a determinant.

A. To find the determinant:

1) 2x2 matrix:

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

a b

ad bcc d

Page 6: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

2) 3x3 matrix:

You can do this with any row of column.

ex: *each person gets a different row or column*

Find det(M)

11 12 13

22 23 21 23 21 221 1 1 2 1 321 22 23 11 12 13

32 33 31 33 31 3231 32 33

( 1) ( 1) ( 1)

a a aa a a a a a

a a a a a aa a a a a a

a a a

1 2 0

3 0 4

0 2 1

M

Page 7: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

3) 4x4 matrix: analogy to 3x3.And so on…

Useful facts: transparency

Do examples illustrating each – base on previous example.

Can use these to simplify finding determinants.

ex:

same

Preclass Q1

1 2 0

3 0 4

0 2 1

M

Page 8: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

B. Cramer’s RuleSay we have a system of equations:

(e.g. 2 equations and 2 unknowns.)

The solutions for x and y are:

Where

(this generalizes any n equations with n unknowns.)

1 1 1

2 2 2

a b c

a b c

1 2det( ) det( )

det( ) det( )

M Mx y

M M

1 1 1 1 1 1

1 2 32 2 2 2 2 2

c b a b a c

M M Mc b a b a c

Page 9: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: find?

Preclass Q2

3 0 2 1

0 2 3 4

3 6 7 12

Page 10: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

III. Matrix Operations

Let

1) Dimension: (# rows) x (# columns) dim (M1) = 3x2 , dim(M3) = 2x3

2) Equality:

Note: a) Matrices must be same size (same dimension).b) This is really a set of mxn equations (aij=bij).c) Row reduction does not give equal matrices.

1 2 3

3 2 1 21 2 3

1 3 , 3 1 , 3 1 2

4 5 2 2

M M M

11 1 11 1

1 1

n n

m mn m mn

ij ij

a a b b

a a b b

iff a b i & j

Page 11: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

3) Transpose: (Exchange rows and columns.)

Then

4) Multiplying by a scalar:

ex:

5) Adding matrices:

ex:

Note: can’t add M1 and M3 because they aren’t the same dimension.

1

3 1 4

2 3 5TM

1

6 4

2 2 6

8 10

M

1 2

4 4

4 4

6 7

M M

Page 12: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

6) Multiplying Matrices: (nxm matrix) x (mxn matrix) = (nxn matrix)

ex:

ijth element [M1M3]ij = Multiply row i by column j and add up terms.

1 3

3 2 9 8 131 2 3

1 3 10 5 93 1 2

4 5 19 13 22

M M

Page 13: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

7) Special Matrices:

• Unit matrix: All diagonal terms are 1, and all others are 0.

(square nxn matrix)

Note: I·M=M·I=M for any matrix M of the same dimension as I.

• Diagonal matrix:

Upper diagonal:

Lower diagonal:

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

I U

1 2 3

0 4 5

0 0 6

1 0 0

2 3 0

4 5 6

Page 14: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

8) Inverse of a matrix: M-1 of a square matrix M is defined by M-1·M=1 and M·M-1=1.Not all matrices M have an inverse M-1.Finding M-1 is a trick! Mathematica or (tediously) by hand.

By hand:M is square, so we can find det(M).

Then

where C is the matrix of cofactors Cij of elements Mij.

defn: Cofactor Cij of Mij is (-1)I+j •

ex:

1 1det( )

TMM C

523

0 2 3

3 0 2

1 3 2

0 2( 1) ( 1)( 2) 2

1 3

M

C

determinant of matrix remaining when row I and column j are crossed out of M.

Page 15: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: Find M-1

0 2 1

1 0 2

1 1 2

M

Page 16: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

IV. Examples

1)3x + 2y + z = -3 x + 2z = 12x + y = 4

We write Ax = bTo solve for x: Ax = b

A-1Ax = A-1b x = A-1 b

3 2 1 3

1 0 2 1

2 1 0 4

x

y

z

A x b

Page 17: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: eliz’s project

laser

Two positions: Measure Tsurf, Ths, Tamb at each. Can write down equation for each slice relating 3 temps. 20 coupled equations!Write in the form:

AP = Ts P = A-1Ts (Matlab solves in 30 seconds.)

1 1

20 20

s

s

s

P T

A

P T

A P T

Page 18: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

2) Geometry: Reflection

(reflects about x-axis)

(reflects about the y-axis)

1 0

0 1

x x

y y

x x

y y?

(x,y)(-x,y)

x

y

Page 19: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

3) Geometry: Rotation of coordinates

(rotates coordinates by θ)

ex: Say I reflect (3,2) about the x-axis and then the y-axis. Then what are it’s coordinates if I use a new coordinate system rotate by /6?

cos sin

sin cos

cos sin

sin cos

x x y

y x y

x x

y y

(x’,y’)y

(x,y)

x

x’

y’

θ

Page 20: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

4) Geometric Optics

Describe each ray by height y and angle θ. Given (y1, θ1), what is (y2, θ2) at the output?

θ2

dLens (focal lenth f1)

θ1

y1y2

Lens (focal lenth f2)

Page 21: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

1

0 1

dM

ex: Propagating through free space

θ1

d

θ2 2 1 1y y d

12 2

siny

d y

1y d

Page 22: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

1

2

1 0

0M n

n

ex: Refraction at boundary

2 1y y

1 1 2 2

1 1 2 2

12 1

2

sin sinn n

n n

n

n

θ1

θ2

y2

y1

Page 23: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

V. Eigenvectors & Eigenvalues

For a given operator (matrix) M, are there any vectors that are left unchanged (except for scaling the length) by M?

eg: where λ is a constant

ex: Reflection at about the y-axis

Eigenvectors [K1,0] , [0,K2] where Eigenvalues λ=-1 λ=1

Mx x

1 0

0 1M

1 2,K K

(x,y)(-x,y)

Page 24: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: Rotation

If θ = 180o, Eigenvectors: all [x,y], eigenvalue λ=-1If θ = 360o, Eigenvectors: all [x,y], eigenvalue λ=1If θ is any other value, there are no eigenvectors & eigenvalues

cos sin

sin cosM

(x,y)

x

y

θ

Page 25: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

More formally: To find eigenvalues:

Characteristic equation:

Solve for eigenvalues ; then you can get the eigenvectors

0

( )( ) 0

a b

c d

a d bc

a b a bM

c d c d

Page 26: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

So, applying this to our examples:

ex: Reflection about y-axis

To find the eigenvalues: Characteristic equation:

What are the eigenvectors?

1 0 1 0

0 1 0 1M

Page 27: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: Rotation

Eigenvalues:

Eigenvectors:

cos sin cos sin

sin cos sin cosM

Page 28: Chapter 3: Linear Algebra I.   Solving sets of linear equations ex:  solve for x, y, z

ex: Find eigenvalues and eigenvectors

5 0 2

0 3 0

2 0 5

M