Steepest Descent Iteration
June 7th, 2008 by Daniel Høyer Iversen
Steepest Descent Iteration , written in Matlab to solve the Advection-diffusion equation. The matrix A (in A x= b) is a block pentadiagonal matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | function Z = solver2(A,b)%Steepest Descent Iteration p=params(0,0); Z=p.noder(:,1)*5; e=A(1,1); for k=1:55000 %Gir feil på 0.2%, men bruker 36s r=b-A*Z; a= (r'*r)/((A*r)'*r); Z=Z+a*r; end |
Hi, I’m undergraduate student of mathematics.
I’m very interesting with ur matlab code.
May I take a copy?
Thx b4.