hw2p3sol

hw2p3sol - A(3,2)=-r r=2 A(5,5)=A(5,5)+r A(6,6)=A(6,6)+r...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 % % Problem 2.4.4 from Watkins % A=zeros(7,7) b=zeros(7,1) % Now we set up the equations by looping over the resistors r=10 A(1,1)=A(1,1)+r A(4,4)=A(4,4)+r A(1,4)=-r A(4,1)=-r r=5 A(4,4)=A(4,4)+r A(7,7)=A(7,7)+r A(4,7)=-r A(7,4)=-r r=2 A(1,1)=A(1,1)+r A(2,2)=A(2,2)+r A(1,2)=-r A(2,1)=-r r=10 A(4,4)=A(4,4)+r A(5,5)=A(5,5)+r A(4,5)=-r A(5,4)=-r r=5 A(7,7)=A(7,7)+r b(7)=b(7)+9*r r=2 A(2,2)=A(2,2)+r A(5,5)=A(5,5)+r A(2,5)=-r A(5,2)=-r r=10 A(5,5)=A(5,5)+r b(5)=b(5)+9*r r=5 A(2,2)=A(2,2)+r A(3,3)=A(3,3)+r A(2,3)=-r
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A(3,2)=-r r=2 A(5,5)=A(5,5)+r A(6,6)=A(6,6)+r A(5,6)=-r A(6,5)=-r r=10 A(3,3)=A(3,3)+r A(6,6)=A(6,6)+r A(3,6)=-r A(6,3)=-r Sheet1 Page 2 r=5 A(6,6)=A(6,6)+r % % Now solve % x=A\b x = 7.32 5.59 4.06 7.67 7.69 3.29 8.34 r=b-A*x r = 1.0e-013 *-0.02-0.07-0.07 0.14 0.07-0.21 kap=cond(A) kap = 18.85 % The error estimate is: kap*norm(r)/norm(b) ans = 5.34E-015 % We conclude we have an accurate solution - more than 14 digits are reliable....
View Full Document

Page1 / 2

hw2p3sol - A(3,2)=-r r=2 A(5,5)=A(5,5)+r A(6,6)=A(6,6)+r...

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

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