help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'orth' command -- question


From: James Sherman Jr.
Subject: Re: 'orth' command -- question
Date: Tue, 17 Apr 2012 02:04:01 -0400

On Tue, Apr 17, 2012 at 1:37 AM, John B. Thoo <address@hidden> wrote:
Hi.  I'm trying to understand the command 'orth'.

Example 1
---------
octave-3.2.3:46> A = [1, 2, 2; 2, 1, 2; 2, 2, 1];

octave-3.2.3:47> [V, LAMBDA] = eig (A); P = orth (V)
P =

  0.62060  -0.53058   0.57735
  0.14920   0.80275   0.57735
 -0.76980  -0.27217   0.57735

octave-3.2.3:48> P'*A*P
ans =

 -1.0000e+00   2.7756e-17  -9.4369e-16
  1.1102e-16  -1.0000e+00   8.6042e-16
 -8.8818e-16   7.7716e-16   5.0000e+00


So, it appears that 'orth' provides an orthonormal basis of eigenvectors of  A.

Example 2
---------
octave-3.2.3:66> A = [4, 1, 0; 1, 4, 1; 0, 1, 4];
octave-3.2.3:67> [V, LAMBDA] = eig (A); P = orth (V)
P =

 -0.023793   0.865699   0.500000
 -0.588348   0.392232  -0.707107
 -0.808257  -0.310998   0.500000

octave-3.2.3:68> P'*A*P
ans =

  4.9791e+00  -6.5271e-01   2.2204e-16
 -6.5271e-01   4.4351e+00   9.9920e-16
  4.4409e-16   6.1062e-16   2.5858e+00

Now it appears that 'orth' does _not_ provide an orthonormal basis of eigenvectors of  A.

Why does 'orth' appear to behave differently in the two examples?

Thanks.

---John.

-----------------------------------------------------------------------
"Ten thousand difficulties do not make one doubt....  A man may be annoyed that he cannot work out a mathematical problem ... without doubting that it admits an answer."

---John Henry Newman [_Apologia_, p. 239 in Project Gutenberg's
  <http://www.gutenberg.org/ebooks/22088>]


_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave

Hi John,

I'm not quite sure what you mean by an "orthonormal basis of eigenvectors of A".  Specifically in your second example, the matrix V is already orthonormal (V'*V = eye(3) and its columns are composed of eigenvectors of A), so I'm not sure what your intention is in calling orth is for.  Also, since orth just looks for an orthonormal basis for the column space of V, and since the eigenvectors found have distinct eigenvalues, they span all of R^3, thus any orthonormal basis for R^3 will suffice.  So, I'd say that it was just luck involved that the first case worked as you had expected and the other case didn't, and it just depends on the particular numerical algorithm involved.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]