Iterações com Pivoteamento
Iterações com Pivoteamento

 

 

Novo Link  de trabalhos academicos http://www.fenix-eng.info

no Mathlab 

 

 

>> %k=0 exercicio 2c da lista tem que fazer pivoteamento 

 

 

 

l10=[3,2,1,-1,5],l20=[0,1,3,0,6],l30=[-3,-5,7,0,-7],l40=[0,2,4,0,15],Matriz=[l10;l20;l30;l40]

 

 

 

>> %fazer pivotiamento trocando a l120 pela 130 

 

% formar nova Matriz pivotiada  

 

 

>> Matriz=[l10;l30;l20;l40]

 

 

 

>> %k=1 - primeiro estagio 

 

>> m21=l30(1)/l10(1),m31=l20(1)/l10(1),m41=l40(1)/l10(1),pivo=[m21;m31;m41]

 

 

>> %operações para zerar a21

 

>> l11=l10,l31=l30-m21*l10,l21=l20-m31*l10,l41=l40-m41*l10,M1=[l11;l31;l21;l41]

 

>> %visualizar a matriz no final do 1 estagio

 

 

>> %k=2 segundo estagio

 

 

>> m32=l21(2)/l31(2),m42=l41(2)/l31(2),Pivo2=[m32;m42]

 

>> % operações para zerar a matriz

 

>> l12=l11,l32=l31,l22=l21-m32*l31,l42=l41-m42*l31,Matriz3=[l12;l32;l22;l42]

 

>> %k3 terceiro estagio

 

 

>> m43=l42(3)/l22(3),Pivo=[m43]

 

 

 

 

>> %Operações para zerar a matriz

 

 

>> l13=l12,l33=l32,l23=l22,l43=l42-m43*l23,Matriz3=[l13;l33;l23;l43]

 

 

 

 

>> % achar x4 

 

 

>> x4=l43(5)/l43(4)

 

>> % achar x3

 

>> x3=(l23(5)-(l23(4)*x4))/l23(3)

 

 

>> % achar x2

 

 

>> x2=(l33(5)-(l33(3)*x3+l33(4)*x4))/l33(2)

 

 

 

>> x1=(l13(5)-(l13(2)*x2+l13(3)*x3+l13(4)*x4))/l13(1)

 

 

 

>> x=[x1;x2;x3;x4]