![]() The call eigs(A,18,4.0) to compute 18 eigenvalues near 4.0 tries to find eigenvalues of A - 4.0*I. However, the repeated eigenvalue at 4 must be handled more carefully. It computes and plots the six largest and smallest magnitude eigenvalues of A successfully with: The eig function computes all 632 eigenvalues. ![]() Legend('eigs(west0479,8)','eig(full(west0479))')Įxample 3: A = delsq(numgrid('C',30)) is a symmetric positive definite matrix of size 632 with eigenvalues reasonably well-distributed in the interval (0 8), but with 18 eigenvalues repeated at 4. This plot shows the 8 largest magnitude eigenvalues of west0479 as computed by eig and eigs. eigs easily picks out the largest magnitude eigenvalues. ![]() Then pass dnRk's additional arguments, 'C' and 15, to eigs.ĭ2 = 2: west0479 is a real 479-by-479 sparse matrix with both real and pairs of complex conjugate eigenvalues. If the problem fits into memory, it may be quicker to use eig(full(A)).Įigs provides the reverse communication required by the Fortran library ARPACK, namely the routines DSAUPD, DSEUPD, DNAUPD, DNEUPD, ZNAUPD, and ZNEUPD.Įxample 1: This example shows the use of function handles.Įquivalently, if dnRk is the following one-line function: ![]() Provide for additional arguments which are passed to Afun(x,p1,p2.).īut is most appropriate for large sparse matrices. In all the eigs syntaxes, eigs(A.) can be replaced by eigs(Afun,n.). The matrix A, A- sigma *I or A- sigma *B represented by Afun is assumed to be real and nonsymmetric unless specified otherwise by opts.isreal and opts.issym. If sigma is a nonzero scalar (generalized eigenvalue problem) I is an identity matrix of the same size as A. If sigma is a nonzero scalar (standard eigenvalue problem). If sigma is not specified, or is a string other than 'sm' MATLAB 5 options stagtol and cheb are no longer allowed.Īccepts the function Afun instead of the matrix A. Permutation vector permB if sparse B is really chol(B(permB,permB)). Note: p must satisfy k < p <= n for real symmetric, k+1 < p <= n otherwise.ġ if B is really its Cholesky factor chol(B), 0 otherwise. Default values are shown in brackets ( ).ġ if A or A- sigma *B represented by Afun is symmetric, 0 otherwise.ġ if A or A- sigma *B represented by Afun is real, 0 otherwise.Ĭonvergence: Ritz estimate residual = 2k ( p >= 2k+1 real nonsymmetric) advised. The MATLAB 5 value sigma = 'be' is obsolete for nonsymmetric and complex problems.Įigs(A,K, sigma,opts) and eigs(A,B,k, sigma,opts) Note, B need only be symmetric (Hermitian) positive semi-definite.įor real symmetric problems, the following are also options:īoth ends (one more from high end if k is odd)įor nonsymmetric and complex problems, the following are also options: If A is a function, Afun must return Y = A\x. Note, B need only be symmetric (Hermitian) positive semi-definite. If A is a function, Afun must return Y = (A- sigma *B)\x (i.e., Y = A\x when sigma = 0). Return k eigenvalues based on sigma, which can take any of the following values: Return the k largest magnitude eigenvalues. eigs(A.) indicates the standard eigenvalue problem A*V = V*D. B must be symmetric (or Hermitian) positive definite and the same size as A. ![]() Solves the generalized eigenvalue problem A*V = B*V*D. If flag is 0 then all the eigenvalues converged otherwise not all converged. Returns a diagonal matrix D of A's six largest magnitude eigenvalues and a matrix V whose columns are the corresponding eigenvectors.Īlso returns a convergence flag. Returns a vector of A's six largest magnitude eigenvalues. I'd appreciate some tips and tricks how to fix this.Eigs (MATLAB Functions) MATLAB Function Referenceįind a few eigenvalues and eigenvectors of a square large sparse matrixĭ = eigs(Afun,n,k, sigma,options,p1,p2.)ĭ = eigs(Afun,n,B,k, sigma,options,p1,p2.) I'm expecting the plot for matrix A to just be similar to the plot of matrix B, but somehow it doesn't work properly. % This is the 2nd matrix for which everything is working fine % This is the 1st matrix which causes some strange plotting results H=1 % for now this seems unnecessary, but I want to change this value later on But I don't know what the problem with the 1st one is. Plotting the 8 eigenvalues as functions of W returns a strange result in the plot which looks like someone rode his bike over my diagram.įor the 2nd matrix, where I just set some off-diagonal elements equal to 0, everything works fine. I'm calculating the eigenvalues of a 8x8-matrix including a symbolic variable "W". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |