This is a very interesting Matlab´s problem. here, i did parts (b) a.pdf
1. This is a very interesting Matlab´s problem. here, i did parts (b) and (c).
At the Matlab´s workspace, i wrote
A=randn(500,500);
xt=randn(500,1);
b=A*xt;
______________________________________
Now we call the function GMRES at the Matlab´s workspace
X = GMRES(A,b,500,1e-6,500)% The function GMRES with A=randn(500,500);,
xt=randn(500,1); and b=A*xt;, restart 500, tol=1e-6, and max number of iterations= 500* 500
gmres converged at iteration 500 to a solution with relative residual 2e-015% matlab´s answer
__________________________________________________________________________
[X,FLAG,RELRES,ITER,RESVEC] = GMRES(A,b,500,1e-6,500)
__________________________________________________________________________-
X =
0.2903
0.4515
0.5905
-2.3149
0.7838
-0.1707
-0.7265
-0.1288
-0.1718
-1.7897
0.4023
1.5591
-0.4952
0.4149
0.8814
0.3116
0.9356
2.1408
-0.8128
-2.0911
-0.8872
15. -0.4357
1.9935
1.0239
1.9519
0.0320
-0.9026
0.1232
-3.0144
-0.8560
-0.4942
-1.8624
_____________________________________________
We can get the same answer with
x = A b
______________________________________________
But, if we call GMRES(100), then
X = GMRES(A,b,100,1e-6,500)%%% at the Matlab´s workspace with m=100, The answer is
really fascinating!!
gmres(100) stopped at outer iteration 0 (inner iteration 0) without converging to the desired
tolerance 1e-006
because the maximum number of iterations was reached.
The iterate returned (number 469(100)) has relative residual 0.77
_________________________________________________________
I run out of time, i will deliver my final answer in a bit. This is a fascinating question.
Solution
This is a very interesting Matlab´s problem. here, i did parts (b) and (c).
At the Matlab´s workspace, i wrote
A=randn(500,500);
xt=randn(500,1);
b=A*xt;
______________________________________
Now we call the function GMRES at the Matlab´s workspace
X = GMRES(A,b,500,1e-6,500)% The function GMRES with A=randn(500,500);,
xt=randn(500,1); and b=A*xt;, restart 500, tol=1e-6, and max number of iterations= 500* 500
30. -1.8624
_____________________________________________
We can get the same answer with
x = A b
______________________________________________
But, if we call GMRES(100), then
X = GMRES(A,b,100,1e-6,500)%%% at the Matlab´s workspace with m=100, The answer is
really fascinating!!
gmres(100) stopped at outer iteration 0 (inner iteration 0) without converging to the desired
tolerance 1e-006
because the maximum number of iterations was reached.
The iterate returned (number 469(100)) has relative residual 0.77
_________________________________________________________
I run out of time, i will deliver my final answer in a bit. This is a fascinating question.