I am working on a problem where the pressure profile is supposed to be smooth. But when I take a log of a certain complex numbers, MATLAB assumes the angle to be from pi to negative pi (clockwise direction)(I guess due to the principal branch being at 0). I am plotting contours and this is causing big discontinuity in my plots. Example
A = log (-(var_z-za2)) where var_z = [20.0 + 0.6i, 20.0 - 0.6i]
za2 =-2.5000 + 0.5000i yields A = [3.11 - 3.13i, 3.11 + 3.091i]
but if we assume the the domain is from 0 to 2pi, counterclockwise direction the same value yields (so no negative angle).
[3.11 + 3.14i, 3.11 + 3.09i]
This is logical and makes more sense in my situation as it would prevent the pressure profiles from rapidly jumping up. Is there anyway to force matlab to use 0 to 2pi for the radians? I would manually ask the code to ignore the point 0 so as to avoid singularity.