Reduced Echelon form is wrong

6 visualizzazioni (ultimi 30 giorni)
Diana Dawoud
Diana Dawoud il 9 Gen 2021
Modificato: John D'Errico il 9 Gen 2021
As you can see the reduced echelon form is wrong, it should be [1 -4.35; 0 0]

Risposte (1)

John D'Errico
John D'Errico il 9 Gen 2021
Modificato: John D'Errico il 9 Gen 2021
A = [-2 2;-.4 .2];
[V,D] = eig(A)
V =
-0.974588432346814 -0.754384720454159
-0.224003097156669 -0.656432550644239
D =
-1.54031242374329 0
0 -0.259687576256715
B = A - D(1,1)*eye(2)
B =
-0.459687576256715 2
-0.4 1.74031242374329
Now, B is a rank 1 matrix. We can approximate the matrix quite well as an outer product of two vectors, as we can see here:
rank(B)
ans =
1
[U,S,V ] = svd(B)
norm(U(:,1)*S(1,1)*V(:,1)' - B)
ans =
1.90253315901036e-15
That rref seems to miss this is just an issue of tolerances.
[R,jb] = rref(A - D(1,1)*eye(2))
R =
1 0
0 1
jb =
1 2
However, if we increase the tolerance by a little beyond the default applied in rref, we see:
[R,jb] = rref(A - D(1,1)*eye(2),1e-14)
R =
1 -4.35078105935822
0 0
jb =
1
Now rref is able to agree with the finding of the other tools.
Remember that all numerical computations are subject to trash in the least significant bits, and that you need to use tolerances properly and carefully to resolve any problem. Understanding the computations done is a huge part of resolving those problems.

Categorie

Scopri di più su Programming in Help Center e File Exchange

Tag

Prodotti


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by