I am stuck in this problem for a long time. I would really appreciate any help I can get. I have a complex equation which has branch cuts (4 of them, but in the attached code I just have one). This shows phase jumps across the y-axis. I am trying to use phase unwrapping so that I don't have any branch cuts in my contour plot. When I have the branch cut horizontally, the problem is easily solved by using the unwrap
function of MATLAB. This I believe is because the branch cuts are in horizontal/vertical rows/columns so they are easily removed. When the branches are angled, I can't use the unwrap
function anymore (as the branches will be angled at for example 30 degree, 45 degrees etc). So, I was wondering if there is anyway to unwrap the phase to get rid of the branch cuts.
This is the case for horizontal with branch discontinuity with discontinuity horizontal:
This is the case for horizontal with no branch discontinuity after phase unwrapping, no discontinuity:
Angle 30 degrees, original, discontinuous:
Angle 30, wrapped phase, still discontinuous:
Please see the attached code. The angle and discontinuity is determined by gamma.
Since the unwrap function applies to column wise, and for cases with angles (other than 0) the discontinuity appears in gamma degrees (so for 30, it would appear at an angle of 30 , and so on), the discontinuity is not removed. Is there a way to extract the elements from a matrix from a mesh using an angle? I would really appreciate any help I could get.
%create mesh
x = [-10:0.1:10];
y = [-10:0.1:10];
[X,Y] = meshgrid(x,y);
%create plane
z =X+1i.*Y;
%constants
zc = [0 ];
xc= real(zc);
yc=imag(zc);
gamma =[30]./360*2*pi; % this determines where the phase jump occurs
L = [ 4];
W = [ 2];
beta = [90]./360*2*pi;
STREN =4.7532e-08.*ones(size(zc,2),1)';
%constants
za1 =zc-exp(1i.*gamma).*(0.5.*L+0.5.*W.*exp(1i.*beta));
x1= real(za1);
y1= imag(za1);
A = -(-X.*cos(gamma)+x1.*cos(gamma)+y1.*sin(gamma)-Y.*sin(gamma));
%phase
f11 = angle(exp(-1i.*gamma).*(za1-z));
P_f_ =A.*f11+real(STREN.*z);
figure
contourf(X,Y,P_f_,25)
colorbar
hold on
anglef1_unwrapped = f11;
%Then sequentially unwrap all the columns one at a time
for i=1:length(A)
anglef1_unwrapped(:,i) = unwrap(f11(:,i));
end
P_single = real(STREN.*z)+A.*anglef1_unwrapped;
figure
contourf(X,Y,P_single,25)
colorbar