16. Intro to Matlab

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

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

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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/25/2011 for the course ENGR 101 taught by Professor Ringenberg during the Fall '07 term at University of Michigan.

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
Ask a homework question - tutors are online