Numerical range
c*-algebra
Miscellanea
c-numerical range plotting
The image is a sample run for A=[1 0 1;0 -1 2;0 0 -1]; c=[1 0 0]; m=50
clg;clc;
disp('');disp('');disp('');disp('');
disp('Programmer: Mao-Ting Chien');
disp(' Department of Mathematics');
disp(' Soochow University');
disp(' Taipei, TAIWAN');
disp(' e-mail: mtchien@scu.edu.tw');
disp(' ');
disp(' Save this file as cnumg.m');
disp('1. run matlab');
disp('2. input this file name cnumg');
disp(' ')
disp(' This program produces the boundary of the c-numerical range of a ');
disp('complex matrix by using MATLAB package, where c is a real n-tuple.');
disp('Enter a complex matrix A, an n-tuple c and the number of ');
disp('boundary points m');
disp('eg. A=[1 2;3 4] enter, c=[5 6] enter, m=50 enter ');
disp(' ');
disp(' ****** Press any key to run the program ******');
pause;
axis;
axis('square')
i=sqrt(-1);
Tol=10^(-5);
A=input('enter a matrix A= ');
C=input('enter an n-tuple c= ');
m=input('enter steps m= ');
% The begin of progran
C=-(sort(-C));
p=[];
for j=1:m+1
theta=(j-1)*2*pi/m;
H=(exp(i*theta)*A+exp(-i*theta)*A')/2;
[X,L]=eig(H);
[lambda,s]=sort(-diag(real(L)));
lambda=-lambda;
X=X(:,s);
k=1;
Y=[];
while k<size(A)
E=[];
if abs(lambda(k)-lambda(k+1)) > Tol
E=X(:,k)/norm(X(:,k));
Y=[Y E];
if k==size(A)-1
E=X(:,k+1)/norm(X(:,k+1));
Y=[Y E];
end
k=k+1;
else
E=[E X(:,k)];
while abs(lambda(k)-lambda(k+1)) <Tol
E=[E X(:,k+1)];
k=k+1;
if (k>=size(A)),break,end
end
E=orth(E);
Y=[Y E];
if k==size(A)-1
E=X(:,k+1)/norm(X(:,k+1));
Y=[Y E];
end
k=k+1;
end
end
for k=1:size(A)
S=Y(:,k)'*A*Y(:,k);
Q(k)=C(k)*S;
end
p(j)=sum(Q);
end
plot(real(p),imag(p));
meta cnumg
% end of the program