如何在计算复数角度时避免分支切割?

时间:2012-02-23 05:22:20

标签: matlab branch angle

我计算复数的sin(the angle在matlab中)的参数\ theta 并将其绘制在能量(循环)上 问题是通过计算角度存在分支切割并且图是不连续的。 如何让我的情节好像没有任何跳跃? 请不要告诉我使用unwrap命令,因为它没有帮助! 下面是我的代码,它非常简单易读:

Emin=0.1; % min value of energy interval
Emax=2;   % max value of energy interval
N = 10; %size of matrix A
NE=100; % no. of points on the energy interval
DE = (Emax-Emin)/(NE-1); % the increment of the interval
Evalues = zeros(NE,1);
ZP= Evalues;
A = zeros(N); %create NxN complex matrix A, this matrix is just an example 
for IE=1:NE       %start loop over energy
    E = Emin+DE*(IE-1); % the energy
    Evalues(IE)=E;
    A = 2+i*magic(N)+0.5;
    A = A*E^(2.3);       % matrix A now depends on E
    eigA = eig(A); % N complex eigenvalues of A
    absA = abs(eigA); %take the abs of the eigenvalues
    argA = angle(eigA); % take the argument of the eigenvalues, cause branch cut!
    Z = (argA/2);
    ZP(IE) = prod(Z); % the product has only real values 
end               % end loop over energy
plot(Evalues,ZP,'o-');
grid on;
outmat = [Evalues ZP]; % concatenation data to a matrix NExNE for saving

0 个答案:

没有答案