16. Intro to Matlab - ENGR 101, Section 100 Gaussian...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
ENGR 101, Section 100 1 Gaussian Elimination, and Intro to MATLAB ENGR 101, Lecture 16: 10 Nov 10 Announcements Project 6 due tonight at 9pm
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ENGR 101, Section 100 2 Convert to a Matrix -1 1/ 2 0 0 -1/ 2 0 0 0 0 0 T 1 0 0 -1/ 2 0 0 -1/ 2 -1 0 0 0 0 T 2 0 0 0 0 1 1/ 2 0 0 0 1 0 T 3 0 0 0 0 0 1/ 2 0 0 0 0 1 T 4 0 1 0 0 0 0 0 1 0 0 0 T 5 0 0 0 0 0 0 0 0 1 0 0 T 6 0 0 -1/ 2 -1 0 0 0 0 0 0 0 W 1x 0 0 1/ 2 0 0 0 0 0 0 0 0 W 1y W/2 0 0 1 -1 0 0 0 0 0 0 W 2x 0 0 0 0 0 0 1 0 0 0 0 W 2y W/2 = Q1: Triangular? Q2: How to solve? Making a Matrix Lower Triangular Idea: transform a matrix to lower-triangular form 1 2 0 a 7 3 0 0 b = 2 -1 8 3 c 0 3 0 0 a 2 1 2 0 b = 7 -1 8 3 c 0 swap rows 1 and 2
Background image of page 2
ENGR 101, Section 100 3 Apply to Statics Problem -1 1/ 2 0 0 -1/ 2 0 0 0 0 0 T 1 0 0 -1/ 2 0 0 -1/ 2 -1 0 0 0 0 T 2 0 0 0 0 1 1/ 2 0 0 0 1 0 T 3 0 0 0 0 0 1/ 2 0 0 0 0 1 T 4 0 1 0 0 0 0 0 1 0 0 0 T 5 0 0 0 0 0 0 0 0 1 0 0 T 6 0 0 -1/ 2 -1 0 0 0 0 0 0 0 W 1x 0 0 1/ 2 0 0 0 0 0 0 0 0 W 1y W/2 0 0 1 -1 0 0 0 0 0 0 W 2x 0 0 0 0 0 0 1 0 0 0 0 W 2y W/2 = pick swaps to get as close to lower-triangular as possible Almost Lower-Triangular 0 -1/ 2 -1 0 0 0 0 0 0 0 T 1 0 0 1/ 2 0 0 0 0 0 0 0 0 T 2 W/2 0 -1/ 2 0 0 -1/ 2 -1 0 0 0 0 T 3 0 0 0 1 -1 0 0 0 0 0 0 T 4 0 -1 1/ 2 0 0 -1/ 2 0 0 0 0 0 T 5 0 0 0 0 0 0 1 0 0 0 0 T 6 W/2 1 0 0 0 0 0 1 0 0 0 W 1x 0 0 0 0 0 0 0 0 1 0 0 W 1y 0 0 0 0 1 1/ 2 0 0 0 1 0 W 2x 0 0 0 0 0 1/ 2 0 0 0 0 1 W 2y 0 = can get close, but not quite there
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ENGR 101, Section 100 4 Another Trick Given two equations: 2x + 3y + z = 5 x + y = 2 multiply one by a scalar and add them to get a new equation: 2x + 3y + z = 5 –2( x + y = 2) y + z = 1 2x + 3y + z = 5 –2x – 2y = – 4 Almost Lower-Triangular 0 -1/ 2 -1 0 0 0 0 0 0 0 T 1 0 0 1/ 2 0 0 0 0 0 0 0 0 T 2 W/2 0 -1/ 2 0 0 -1/ 2 -1 0 0 0 0 T 3 0 0 0 1 -1 0 0 0 0 0 0 T 4 0 -1 1/ 2 0 0 -1/ 2 0 0 0 0 0 T 5 0 0 0 0 0 0 1 0 0 0 0 T 6 W/2 1 0 0 0 0 0 1 0 0 0 W 1x 0 0 0 0 0 0 0 0 1 0 0 W 1y 0 0 0 0 1 1/ 2 0 0 0 1 0 W 2x 0 0 0 0 0 1/ 2 0 0 0 0 1 W 2y 0 = Add row 6 to row 3
Background image of page 4
5 Almost Lower-Triangular (cont.) 0 -1/ 2 -1 0 0 0 0 0 0 0 T 1 0 0 1/ 2 0 0 0 0 0 0 0 0 T 2 W/2 0 -1/ 2 0 0 -1/ 2 0 0 0 0 0 T 3 W/2 0 0 1 -1 0 0 0 0 0 0 T 4 0 -1 1/ 2 0 0 -1/ 2 0 0 0 0 0 T 5 0 0 0 0 0 0 1 0 0 0 0 T 6 W/2 1 0 0 0 0 0 1 0 0 0 W 1x 0 0 0 0 0 0 0 0 1 0 0 W 1y 0 0 0 0 1 1/ 2 0 0 0 1 0 W 2x 0 0 0 0 0 1/ 2 0 0 0 0 1 W 2y 0 = Subtract row 5 from row 3 –1 Almost Lower-Triangular (cont.) 0 -1/ 2 -1 0 0 0 0 0 0 0 T 1 0 0 1/ 2 0 0 0 0 0 0 0 0 T 2 W/2 1 -2/ 2 0 0 0 0 0 0 0 0 T 3 W/2 0 0 1 -1 0 0 0 0 0 0 T 4 0 -1 1/ 2
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

16. Intro to Matlab - ENGR 101, Section 100 Gaussian...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online