天天看點

【機械】二維鋼桁架分析與設計附matlab代碼

1 内容介紹

主要介紹了某屋蓋鋼桁架結構的體系,分析條件,相關計算結果及支座節點的設計等

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 運作結果

【機械】二維鋼桁架分析與設計附matlab代碼

4 參考文獻

部分理論引用網絡文獻,若有侵權聯系部落客删除。