Lecture14 - Engineering Analysis ENG 3420 Fall 2009 Dan C....

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

View Full Document Right Arrow Icon
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Lecture 14 Lecture 14 Last time: Solving systems of linear equations (Chapter 9) Graphical methods Cramer’s rule Gauss elimination Today: Discussion of pivoting Tri-diagonal system solver Examples Next Time LU Factorization (Chapter 10)
Background image of page 2
function x= GaussNaive(A,b ) ExA =[A b]; [ m,n ]= size(A ); q= size(b ); if (m~=n) fprintf ('Error: input matrix is not square; n = %3.0f, m=%3.0f \n', n,m ); End if (n~=q) fprintf ('Error: vector b has a different dimension than n; q = %2.0f \n', q); end n1=n+1; for k=1:n-1 for i=k+1:n factor= ExA(i,k)/ExA(k,k ); ExA(i,k:n1)= ExA(i,k:n1)-factor*ExA(k,k:n1); End End x=zeros(n,1); x(n )=ExA(n,n1)/ExA(n,n); for i=n-1:-1:1 x(i ) = (ExA(i,n1)-ExA(i,i+1:n)*x(i+1:n))/ExA(i,i); end
Background image of page 3

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

View Full DocumentRight Arrow Icon
>> A=[1 1 1 0 0 0 ; 0 -1 0 1 -1 0 ; 0 0 -1 0 0 1 ; 0 0 0 0 1 -1 ; 0 10 -10 0 -15 -5 ; 5 -10 0 -20 0 0] A = 1 1 1 0 0 0 0 -1 0 1 -1 0 0 0 -1 0 0 -1 0 0 0 0 1 -1 0 10 -10 0 -15 -5 5 -10 0 -20 0 0 b = [0 0 0 0 0 200] >> b=b' b = 0 0 0 0 0 200 >> x = GaussNaive(A,b) x = NaN NaN NaN NaN NaN NaN
Background image of page 4
Pivoting
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.

This note was uploaded on 02/17/2012 for the course EGN 3420 taught by Professor Staff during the Spring '08 term at University of Central Florida.

Page1 / 10

Lecture14 - Engineering Analysis ENG 3420 Fall 2009 Dan C....

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