Unwrap Phase Angle in a contour plot

8 ビュー (過去 30 日間)
Bahar
Bahar 2014 年 5 月 6 日
Hello,
I am trying to plot amplitude and phase angle for stress components in soil for a constant frequency. Everything looks good (Amplitude, Real, and Imaginary part) But when it comes to calculate phase angle, I get unreasonable results due to jumps in phase angle. I know the function "unwrap" would fix this problem when angle is plotted with respect to frequency, but here the frequency is constant and the location (vertical, horizontal) is changing.
I really appreciate any suggestion/guidance. The following code is for plotting phase angle, while I put real, imag, and amplitude figures for reference.
phase angle is calculated as arctan(Imag/Real) and adjusted to have the value of -pi to pi.
clc; clear all; x = load('horizontal.txt'); z = load('vertical.txt');
Phase_shear = load('shearphase.txt');
% use meshgrid to create X and Y mesh
nlin = 100;
xlin = linspace(min(x),max(x),nlin);
zlin = linspace(min(z),max(z),nlin);
[X,Z] = meshgrid(xlin,zlin);
s_s = griddata(x,z,Phase_shear,X,Z);
figure (1) contourf(X,Z,s_s,1000,'linestyle','none'); colorbar; xlabel('x/a') ylabel('z/a') % caxis([0, 2*pi()]) % ylim([0 5]) xlim([0 2.5]) set(gca,'YDir','Reverse') title('\tau_r_z/p Phase Angle (Radians)')
Thank you, Bahar

回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by