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. |