Previous Page Next Page Contents

numeric::spectralradius -- the spectral radius of a matrix

Introduction

numeric::spectralradius(A, ..) returns the eigenvalue of the matrix A that has the largest absolute value.

Call(s)

numeric::spectralradius(A, x0, n)

Parameters

A - an m x m matrix of domain type DOM_ARRAY or of category Cat::Matrix
x0 - a starting vector: a 1-dimensional array or a list of length m
n - the maximal number of iterations: a positive integer

Returns

A list [lambda, x, residue] is returned. lambda is a floating point approximation of the the eigenvalue of largest absolute value. The 1-dimensional array x is a numerical eigenvector corresponding to lambda. residue is a floating point number indicating the numerical quality of lambda and x.

Side Effects

The function is sensitive to the environment variable DIGITS, which determines the numerical working precision.

Related Functions

linalg::eigenvalues, linalg::eigenvectors, numeric::eigenvalues, numeric::eigenvectors, numeric::singularvalues, numeric::singularvectors

Details

Example 1

We define a starting vector as a 1-dimensional array and allow a maximum of 1000 internal iterations:

>> A := array(1..2, 1..2, [[1, 2], [5, -10]]):
   x0 := array(1..2, [1, 1]):
   numeric::spectralradius(A, x0, 1000)
      --               +-                          -+
      |  -10.84429006, | 0.166500972, -0.9860412904 |,
      --               +-                          -+
      
                         --
         1.041382012e-11  |
                         --

Next we use a list to specify a starting vector:

>> A := array(1..2, 1..2, [[I, 3], [3, I]]):
   numeric::spectralradius(A, [1, 1], 1000)
          --              +-                          -+      --
          |  3.0 + 1.0 I, | 0.7071067812, 0.7071067812 |, 0.0  |
          --              +-                          -+      --
>> delete A, x0:

Example 2

The following matrix has two distinct eigenvalues 1 and -1 of the same absolute value. The power method must fail.

>> A := array(1..2, 1..2, [[1, 0], [0, -1]]):

We allow a maximum of 1000 internal steps. The call results in a warning. The large residue also indicates that the power method did not converge:

>> numeric::spectralradius(A, [1, 1], 1000)
      Warning: no convergence of vector iteration [numeric::spectral\
      radius]
      
              --      +-                           -+      --
              |  0.0, | 0.7071067812, -0.7071067812 |, 1.0  |
              --      +-                           -+      --
>> delete A:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000