【机械】二维钢桁架分析与设计附matlab代码
主要介绍了某屋盖钢桁架结构的体系,分析条件,相关计算结果及支座节点的设计等
2 部分代码function Plot_Results(Node,Element,Mag_Factor,Result_type)
NNode=length(Node);
for i=1:1:NNode
X(i,1)=Node{i}.x;
Y(i,1)=Node{i}.y;
Ux(i,1)=Node{i}.Ux;
Uy(i,1)=Node{i}.Uy;
end
figure;
X=X+Ux*Mag_Factor;
Y=Y+Uy*Mag_Factor;
NElement=length(Element);
for i=1:1:NElement
if Result_type==1
Result(i,1)=Element{i}.Strain;
end
if Result_type==2
Result(i,1)=Element{i}.Stress;
end
if Result_type==3
Result(i,1)=Element{i}.Axial_Force;
end
if Result_type==4
Result(i,1)=Element{i}.Ratio;
end
Lines(i,:)=Element{i}.Nodes;
end
if Result_type==0
plot(X,Y,'o','MarkerFaceColor','m','MarkerEdgeColor','k');
for j = 1:NElement
line(X(Lines(j,:)),Y(Lines(j,:)),'color','red','LineWidth',2);
end
else
cmap = colormap;
c = round(1+(size(cmap,1)-1)*(Result - min(Result))/(max(Result)-min(Result)));
if isnan(c); c=round(1+(size(cmap,1)-1)/2)*ones(size(Result,1),1); end
plot(X,Y,'o','MarkerFaceColor','m','MarkerEdgeColor','k');
for j = 1:NElement
line(X(Lines(j,:)),Y(Lines(j,:)),'color',cmap(c(j),:),'LineWidth',2);
end
colorbar
caxis([ min(Result) , max(Result)]);
if sum(abs(Result))==0; caxis([-1 1]); end
end
daspect([1 1 1]);
end
3 运行结果4 参考文献[1]李罡. "基于matlab的空间三维桁架结构受力分析通用程序设计." 喀什师范学院学报 26.3(2005):4.
部分理论引用网络文献,若有侵权联系博主删除。版权声明
本文仅代表作者观点,不代表博信信息网立场。