Page 256 - MATLAB an introduction with applications
P. 256

Numerical Methods ———  241


                           Q(1:k) = zeros(1,k);
                           Q(k+1:n) = V(k+1:n)–c*W(k+1:n);
                           A(k+2:n,k) = zeros(n–k–1,1);
                           A(k,k+2:n) = zeros(1,n–k–1);
                           A(k+1,k) = –s;
                           A(k,k+1) = –s;
                           A(k+1:n,k+1:n) = A(k+1:n,k+1:n) ...
                              –2*W(k+1:n)’*Q(k+1:n)–2*Q(k+1:n)’*W(k+1:n);
                        end
                        T = A;
                        fprintf(‘Matrix in tridiagonal form is\n’);
                         disp(T);
                   The output of the program is given below:
                   Matrix in tridiagonal form is
                         4.0000   –3.7417   0        0
                        –3.7417    6.5714   2.7180   0
                         0         2.7180   3.0529   1.2403
                         0         0        1.2403   2.3757


                   Example E4.19: Use the Sturn sequence property to find the interval of the smallest eigenvalue of

                                                      2  − 1  0  0 
                                                     − 1  2  − 2  0  
                                                A =              
                                                      0  − 2  2  − 1
                                                                 
                                                       0  0  − 1  2  

                   Solution: The sequence {f (a)} and {f (b) can be used to determine the number of roots of f (λ), which are
                                                  k
                                        k
                                                                                             n
                   contained in [a, b].
                       The sequence {f , f ,..., fn} forms a Sturn sequence of polynomials; and such sequences have special
                                    0
                                      1
                   properties. Given a point b, calculate
                                                               { ( ), ( ),...,fb f b  f n  ( )}
                                                                   b
                                                     0
                                                          1
                                                                   0
                                                              ()
                                                                                           ()
                   and observe the signs of these quantities. If some  f λ= , then choose the sign of  f λ to be opposite
                                                             j
                                                                                          j
                   to that of  f j− 1 () λ . It can be shown that
                                                                f λ= ⇒  f  j− 1 () λ≠  0
                                                      ()
                                                           0
                                                     j
                                                            λ
                   Having obtain a sequence of signs from flet  s  ()  denote the number of agreements of sign between
                   consecutive members of the sign sequence.
   251   252   253   254   255   256   257   258   259   260   261