资源描述:
《2012年-有限元作业-matlab编程实现有限元求解简单结构位移及应力》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、2012年有限元作业对于三角形单元有:1、形函数其中:相乘后得:也可写成:简写为:其中2、应变有弹性力学知道:,可得3、应力4、刚度矩阵题目:如图所示是一平面梁。载荷沿梁的上边均匀分布,其单位长度上的分布载荷P=100N/cm。假定μ=0,墙梁的厚度t=0.1cm。在不计自重情况下,试求其位移和应力。MATLAB程序:%FiniteElementAnalysisE=1;u=0;%对单元1进行分析xy1=[0,0;6,6;0,6];A1=0.5*det([1,xy1(1,1),xy1(1,2);1,xy1(2,1),xy1(2,2);1,
2、xy1(3,1),xy1(3,2)]);B1=zeros(3,6);B1(1,1)=xy1(2,2)-xy1(3,2);B1(1,3)=xy1(3,2)-xy1(1,2);B1(1,5)=xy1(1,2)-xy1(2,2);B1(2,2)=xy1(3,1)-xy1(2,1);B1(2,4)=xy1(1,1)-xy1(3,1);B1(2,6)=xy1(2,1)-xy1(1,1);B1(3,1)=xy1(2,2)-xy1(3,2);B1(3,2)=xy1(3,1)-xy1(2,1);B1(3,3)=xy1(3,2)-xy1(1,2);B1(
3、3,4)=xy1(1,1)-xy1(3,1);B1(3,5)=xy1(1,2)-xy1(2,2);B1(3,6)=xy1(2,1)-xy1(1,1);%对单元2进行分析xy2=[0,0;6,0;6,6];A2=0.5*det([1,xy2(1,1),xy2(1,2);1,xy2(2,1),xy2(2,2);1,xy2(3,1),xy2(3,2)]);B2=zeros(3,6);B2(1,1)=xy2(2,2)-xy2(3,2);B2(1,3)=xy2(3,2)-xy2(1,2);B2(1,5)=xy2(1,2)-xy2(2,2);B2(
4、2,2)=xy2(3,1)-xy2(2,1);B2(2,4)=xy2(1,1)-xy2(3,1);B2(2,6)=xy2(2,1)-xy2(1,1);B2(3,1)=xy2(2,2)-xy2(3,2);B2(3,2)=xy2(3,1)-xy2(2,1);B2(3,3)=xy2(3,2)-xy2(1,2);B2(3,4)=xy2(1,1)-xy2(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