Contour not being rendered for non-finite data??

7 ビュー (過去 30 日間)
Natali Petani
Natali Petani 2022 年 12 月 4 日
コメント済み: VBBV 2022 年 12 月 5 日
I am getting the following warning and my contourf is returning blank
Warning: Contour not rendered for non-finite ZData
> In contourf (line 60)
In Project1 (line 23)
%crack length - for Kanalytical
a = 0.1;
K = sqrt(pi*a)*1000;
%grid for results to look like plate, adjusting for crack edge tip
[x,y] = meshgrid(-0.1:0.01:1-a, -0.5:0.01:0.5);
%polar coordinates
r = sqrt(x.^2+y.^2);
theta = atan(y./x);
%Airy stress ; for a = 10cm
sigmaxx = (K./sqrt(2*pi*r)).*cos(theta/2).*(1-(sin(theta/2).*sin(3*theta/2)));
sigmayy = (K./sqrt(2*pi*r)).*cos(theta/2).*(1+(sin(theta/2).*sin(3*theta/2)));
tauxy = (K./sqrt(2*pi*r)).*cos(theta/2).*(sin(theta/2).*cos(3*theta/2));
sigmavm = ((.5*(((sigmaxx-sigmayy)^2)+(sigmaxx^2)+(sigmayy^2)))+(3*(tauxy^2))^.5);
%surface of plate
surf(x,y,sigmavm);
xlabel('X'), ylabel('Y'), zlabel('von Mises Stress')
figure(1);
contourf(x,y,sigmavm)
xlabel('X'), ylabel('von Mises Stress')
%sigmayy along theta = 0
figure(2);
[i,j]=meshgrid(-0.1:0.01:1-a, -0.5:0.01:0.5);
rr = sqrt(x.^2+y.^2);
M=K./(sqrt(2*pi*rr));
figure(2)
plot(rr,M,'-',Color='b')
xlim([-0.1, 0.9])
xlabel('X'), ylabel('Sigmayy'), title('Sigmayy versus r at theta = 0');

回答 (1 件)

VBBV
VBBV 2022 年 12 月 5 日
%crack length - for Kanalytical
a = 0.1;
K = sqrt(pi*a)*1000;
%grid for results to look like plate, adjusting for crack edge tip
[x,y] = meshgrid(-0.1:0.03:1-a, -0.5:0.03:0.5);
%polar coordinates
r = sqrt(x.^2+y.^2);
theta = atan(y./x);
%Airy stress ; for a = 10cm
sigmaxx = (K./sqrt(2*pi*r)).*cos(theta/2).*(1-(sin(theta/2).*sin(3*theta/2)));
sigmayy = (K./sqrt(2*pi*r)).*cos(theta/2).*(1+(sin(theta/2).*sin(3*theta/2)));
tauxy = (K./sqrt(2*pi*r)).*cos(theta/2).*(sin(theta/2).*cos(3*theta/2));
sigmavm = ((.5*(((sigmaxx-sigmayy)^2)+(sigmaxx^2)+(sigmayy^2)))+(3*(tauxy^2))^.5);
%surface of plate
surf(x,y,real(sigmavm));
xlabel('X'), ylabel('Y'), zlabel('von Mises Stress')
figure(1);
contourf(x,y,real(sigmavm))
xlabel('X'), ylabel('von Mises Stress')
%sigmayy along theta = 0
figure(2);
[i,j]=meshgrid(-0.1:0.03:1-a, -0.5:0.03:0.5);
rr = sqrt(x.^2+y.^2);
M=K./(sqrt(2*pi*rr));
figure(2)
plot(rr,M,'-',Color='b')
xlim([-0.1, 0.9])
xlabel('X'), ylabel('Sigmayy'), title('Sigmayy versus r at theta = 0');
  1 件のコメント
VBBV
VBBV 2022 年 12 月 5 日
use a grid resolution to avoid singularity, i.e. zero
[x,y] = meshgrid(-0.1:0.03:1-a, -0.5:0.03:0.5); %
since these expressions have the reciprocals of x and y variables at which value becomes infinite
sigmaxx = (K./sqrt(2*pi*r)).*cos(theta/2).*(1-(sin(theta/2).*sin(3*theta/2)));
sigmayy = (K./sqrt(2*pi*r)).*cos(theta/2).*(1+(sin(theta/2).*sin(3*theta/2)));
tauxy = (K./sqrt(2*pi*r)).*cos(theta/2).*(sin(theta/2).*cos(3*theta/2));

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by