CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   the solution for illcondizioned matrix (https://www.cfd-online.com/Forums/main/16110-solution-illcondizioned-matrix.html)

giuseppe casillo December 9, 2008 06:35

the solution for illcondizioned matrix
 
%the A matrix end the b know terms must be i memory

%programma per la risoluzione di matrici malcondizionate e %p.i.m % matrice in A terminenoto in b %risolve pure le matrici a determinante nullo % Ainvertallok

AA=A*A;

sp=max(eig(AA))/1.9;

n=size(A);

m=n(1);

xold=zeros(m,1);

Ab=A*b/sp;

AA=AA/sp;

for i=1:2000

xn=Ab+xold-AA*xold ;

s=0.0;

for l=1:m

if (xn(l)==0.0)

else

s=s+abs((xn(l)-xold(l))/xn(l));

end;

end;

xold=xn;

if ( s <(0.0015*m))

break,

end;

end;

i

xn

%

%questo metodo risolve in media i problemi %con determinante nullo:in media perchè è % A*(A*x-b)=0


All times are GMT -4. The time now is 08:46.