% 定义主应力取值范围 sigma_max = 500; % 最大主应力 sigma_min = -500; % 最小主应力 n = 100; % 主应力取值数量 sigma1_range = linspace(sigma_min, sigma_max, n); sigma2_range = linspace(sigma_min, sigma_max, n); sigma3_range = linspace(sigma_min, sigma_max, n); % 计算Mises屈服面 mises = zeros(n, n, n); for i = 1:n for j = 1:n for k = 1:n sigma1 = sigma1_range(i); sigma2 = sigma2_range(j); sigma3 = sigma3_range(k); mises(i,j,k) = sqrt((sigma1-sigma2)^2+(sigma2-sigma3)^2+(sigma3-sigma1)^2)/sqrt(2)-50; end end end % 绘制Mises屈服面 sigma_y = 100; % 屈服强度 isosurface(sigma1_range, sigma2_range, sigma3_range, mises, sigma_y);将这个三维曲面画在x,y平面内
时间: 2023-12-14 10:03:38 浏览: 153
要将Mises屈服面画在x,y平面内,可以使用以下代码:
```
sigma_max = 500; % 最大主应力
sigma_min = -500; % 最小主应力
n = 100; % 主应力取值数量
sigma1_range = linspace(sigma_min, sigma_max, n);
sigma2_range = linspace(sigma_min, sigma_max, n);
sigma3_range = linspace(sigma_min, sigma_max, n);
mises = zeros(n, n, n);
for i = 1:n
for j = 1:n
for k = 1:n
sigma1 = sigma1_range(i);
sigma2 = sigma2_range(j);
sigma3 = sigma3_range(k);
mises(i,j,k) = sqrt((sigma1-sigma2)^2+(sigma2-sigma3)^2+(sigma3-sigma1)^2)/sqrt(2)-50;
end
end
end
sigma_y = 100; % 屈服强度
% 绘制Mises屈服面
p = patch(isosurface(sigma1_range, sigma2_range, sigma3_range, mises, sigma_y));
isonormals(sigma1_range, sigma2_range, sigma3_range, mises, p)
set(p, 'FaceColor', 'red', 'EdgeColor', 'none', 'FaceAlpha', 0.3);
% 将视角调整为俯视图,使曲面在x,y平面内可见
view(0,90);
```
这将绘制一个红色的Mises屈服面,屈服强度为100,透明度为0.3,且将视角调整为俯视图,使曲面在x,y平面内可见。
阅读全文