资源描述:
《哈工大材料力学上机》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、材料力学上机大作业应力状态分析曹启迪1120810831一、问题的提出该程序可以解决的问题:①平面应力状态,已知σx,σy,τxy和角度的情况下计算不同任意截面的应力分量,还可以计算平面应力状态主应力的大小和方向并能画出应力圆;②空间应力状态,已知σx,σy,σz,τxy等的情况下计算主应力和最大切应力。二、程序源代码平面PrivateSubCommand1_Click()DimδxAsDouble,δyAsDouble,τxyAsDouble,аAsDouble,XAsDouble,YAsDouble,zAsDoubleδx=Val(Text1.Text)δy=
2、Val(Text2.Text)τxy=Val(Text3.Text)а=Val(Text4.Text)X=0Y=(δx+δy)/2+((δx-δy)^2/4+τxy^2)^0.5z=(δx+δy)/2-((δx-δy)^2/4+τxy^2)^0.5IfX>=YAndX>=zThenText5.Text=Str(X)Text6.Text=Str(Y)Text7.Text=Str(z)Text8.Text=Str((X-z)/2)ElseIfX<=YAndX<=zThenText5.Text=Str(Y)Text6.Text=Str(z)Text7.Text=Str(
3、X)Text8.Text=Str((Y-X)/2)ElseText5.Text=Str(Y)Text6.Text=Str(X)Text7.Text=Str(z)Text8.Text=Str((Y-z)/2)EndIfEndIfText9.Text=Str((δx+δy)/2+(δx-δy)/2*Cos(2*а)+τxy*Sin(2*а))Text10.Text=Str(-(δx-δy)/2*Sin(2*а)+τxy*Cos(2*а))Ifδx=δyThenText11.Text=Str(45)ElseText11.Text=Str(Atn(τxy^2/(δx-δy
4、))/2)EndIfIf((δx-δy)^2/4+τxy^2)^0.5<=50And((δx-δy)^2/4+τxy^2)^0.5>=20ThenPicture1.ScaleMode=3Picture1.Scale(0,0)-(200,80)Picture1.Scale(-100,40)-(100,-40)Picture1.Line(-100,0)-(100,0)Picture1.Line(0,-40)-(0,40)Picture1.Circle((δx+δy)/2,0),((δx-δy)^2/4+τxy^2)^0.5,QBColor(12)ElseIf((δx-
5、δy)^2/4+τxy^2)^0.5<20And((δx-δy)^2/4+τxy^2)^0.5>0ThenPicture1.ScaleMode=3Picture1.Scale(0,0)-(80,40)Picture1.Scale(-40,20)-(40,-20)Picture1.Line(-40,0)-(40,0)Picture1.Line(0,-20)-(0,20)Picture1.Circle((δx+δy)/2,0),((δx-δy)^2/4+τxy^2)^0.5,QBColor(12)ElsePicture1.ScaleMode=3Picture1.Sca
6、le(0,0)-(400,200)Picture1.Scale(-200,100)-(200,-100)Picture1.Line(-200,0)-(200,0)Picture1.Line(0,-100)-(0,100)Picture1.Circle((δx+δy)/2,0),((δx-δy)^2/4+τxy^2)^0.5,QBColor(12)EndIfEndIfEndSubPrivateSubCommand2_Click()Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""Text5.Text=""Text
7、6.Text=""Text7.Text=""Text8.Text=""Text9.Text=""Text10.Text=""Text11.Text=""Picture1.ClsEndSub空间PrivateSubCommand1_Click()DimδxAsDouble,δyAsDouble,δzAsDouble,τxyAsDouble,τyzAsDouble,τzxAsDoubleδx=Val(Text1.Text)δy=Val(Text3.Text)δz=Val(Text2.Text)τxy=Val(Text4.Text)τyz=Val(Text5.Text)
8、τzx=V