哈工大材料力学上机作业.docx
《哈工大材料力学上机作业.docx》由会员分享,可在线阅读,更多相关《哈工大材料力学上机作业.docx(32页珍藏版)》请在冰豆网上搜索。
哈工大材料力学上机作业
材料力学上机作业
设计题目:
应力状态、压杆稳定性分析
院系:
机电学院
班级:
1208103
完成者:
学号:
指导教师:
张桂莲
设计时间:
2014.6.2
哈尔滨工业大学
一、问题描述
1.应力状态分析:
输入:
1 平面应力状态输入:
(σx、σy、τxy);某截面方位角α;
2 空间应力状态输入:
(σx、σy、σz、τxy、τyz、τzx)。
输出:
1 输出主应力(σ1、σ2、σ3);
2 最大切应力(τmax=τ13=);
3 如为平面应力状态则需输出方位角α斜截面上的应力σα、τα及主方位角ασ;
4 画出应力圆示意图。
2.压杆稳定分析
输入:
1 截面参数输入:
圆截面—d;
圆环截面—D,d;
矩形截面—h,b;
工字型截面—对形心轴的惯性矩Iy、Iz及截面面积A;
2 相当长度系数
、长度l;
3 材料参数:
E、,σp、σs;线性经验公式系数a、b;
4 工作压力P及稳定安全系数n。
输出:
1 绘制临界应力总图(图示);
2 临界压力Pcr或临界应力σcr;
3 稳定安全校核结果。
2、数学模型
1.应力状态分析
(1)平面应力状态:
主应力计算公式:
主平面方位计算公式:
最大切应力:
与主平面45度角的平面方位:
应力圆:
(2)空间应力状态
特征方程:
其中:
2.压稳定性分析
根据相关公式:
(1)当
时采用欧拉公式,
;
(2)当
时采用直线公式,
;
(3)当
时考虑强度问题。
而后,
当
则压杆处于安全状态,否则处于非安全状态
三、程序源代码
PrivateSubCommand1_Click()
Me.Hide
Form1.Visible=True
EndSub
PrivateSubCommand2_Click()
End
EndSub
PrivateSubCommand1_Click()
Me.Hide
Form2.Visible=True
EndSub
PrivateSubCommand2_Click()
Me.Hide
Form3.Visible=True
EndSub
PrivateSubCommand3_Click()
Me.Hide
Form8.Visible=True
EndSub
PrivateSubCommand4_Click()
Me.Hide
Form9.Visible=True
EndSub
PrivateSubCommand5_Click()
Me.Hide
Form7.Visible=True
EndSub
PrivateSubCommand6_Click()
Me.Hide
Form6.Visible=True
EndSub
PrivateSubTimer1_Timer()
EndSub
PrivateSubCommand1_Click()
DimδxAsDouble,δyAsDouble,τxyAsDouble,аAsDouble,XAsDouble,YAsDouble,zAsDouble
'输入数据(δx,δy,τxy);某截面方位角а"
δx=Val(Text1.Text)
δy=Val(Text2.Text)
τxy=Val(Text3.Text)
а=Val((Text4.Text)/180*4*Atn
(1))
'计算主应力
X=0
Y=(δx+δy)/2+((δx-δy)^2/4+τxy^2)^0.5
z=(δx+δy)/2-((δx-δy)^2/4+τxy^2)^0.5
'比较大小,输出主应力(δ1,δ2,δ3)和最大剪应力τmax=τ13=(δ1-δ3)/2
IfX>=YAndX>=zThen
Text5.Text=Str(X)
Text6.Text=Str(Y)
Text7.Text=Str(z)
Text8.Text=Str((X-z)/2)
Else
IfX<=YAndX<=zThen
Text5.Text=Str(Y)
Text6.Text=Str(z)
Text7.Text=Str(X)
Text8.Text=Str((Y-X)/2)
Else
Text5.Text=Str(Y)
Text6.Text=Str(X)
Text7.Text=Str(z)
Text8.Text=Str((Y-z)/2)
EndIf
EndIf
'计算并输出δа,τа,аδ
Text9.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=δyThen
Text11.Text=Str(45)
Else
Text11.Text=Str((Atn(τxy*2/(δx-δy))/2)/(4*Atn
(1))*180)
EndIf
'输出应力圆
If((δx-δy)^2/4+τxy^2)^0.5<=50And((δx-δy)^2/4+τxy^2)^0.5>=20Then
'半径在20-50间的输出
Picture1.ScaleMode=3
Picture1.Scale(0,0)-(2000,80)
Picture1.Scale(-100,40)-(1000,-40)
Picture1.Line(-100,0)-(1000,0)
Picture1.Line(0,-40)-(0,40)
Picture1.Circle((δx+δy)/2,0),((δx-δy)^2/4+τxy^2)^0.5,QBColor(12)
Else
If((δx-δy)^2/4+τxy^2)^0.5<20And((δx-δy)^2/4+τxy^2)^0.5>0Then
'半径在0-20间的输出
Picture1.ScaleMode=3
Picture1.Scale(0,0)-(800,40)
Picture1.Scale(-40,20)-(400,-20)
Picture1.Line(-40,0)-(400,0)
Picture1.Line(0,-20)-(0,20)
Picture1.Circle((δx+δy)/2,0),((δx-δy)^2/4+τxy^2)^0.5,QBColor(12)
Else
'半径在大于50间的输出
Picture1.ScaleMode=3
Picture1.Scale(0,0)-(4000,200)
Picture1.Scale(-200,100)-(2000,-100)
Picture1.Line(-200,0)-(2000,0)
Picture1.Line(0,-100)-(0,100)
Picture1.Circle((δx+δy)/2,0),((δx-δy)^2/4+τxy^2)^0.5,QBColor(12)
EndIf
EndIf
EndSub
PrivateSubCommand2_Click()
'清空文本框
Text1.Text=""
Text2.Text=""
Text3.Text=""
Text4.Text=""
Text5.Text=""
Text6.Text=""
Text7.Text=""
Text8.Text=""
Text9.Text=""
Text10.Text=""
Text11.Text=""
'清除图片框
Picture1.Cls
'返回光标
Text1.SetFocus
EndSub
PrivateSubCommand3_Click()
Me.Hide
Form1.Visible=True
EndSub
PrivateSubCommand4_Click()
Me.Hide
Form4.Visible=True
EndSub
PrivateSubCommand1_Click()
DimδxAsDouble,δyAsDouble,δzAsDouble,τxyAsDouble,τyzAsDouble,τzxAsDouble
'输入数据(δx,δy,δz,τxy,τyz,τzx)
δx=Val(Text13.Text)
δy=Val(Text14.Text)
δz=Val(Text15.Text)
τxy=Val(Text16.Text)
τyz=Val(Text17.Text)
τzx=Val(Text18.Text)
'计算I1,I2,I3;得到方程"x^3-I1*x^2+I2*x-I3=0"
I1=δx+δy+δz
I2=δx*δy-τxy^2+δy*δz-τyz^2+δz*δx-τzx^2
I3=(δy*δz-τyz^2)*δx-(τxy*δz-τyz*τzx)*τxy+(τxy*τyz-τzx*δy)*τzx
'用盛金公式求解方程"x^3-I1*x^2+I2*x-I3=0"的根X1,X2,X3
a=I1^2-3*1*I2
b=-I1*I2+9*1*I3
c=I2^2-3*I1*I3
d=b^2-4*a*c
'当有三个相等实根时
If(a=0Andb=0)Then
X1=I1/3
X2=I1/3
X3=I1/3
EndIf
'当有两个相等实根时
If(a<>0Andd=0)Then
X1=I1+b/a
X2=-b/(2*a)
X3=-b/(2*a)
EndIf
'当有三个互不相等实根时
If(d<0Anda>0)Then
t=(-2*a*I1-3*b)/(2*a^(3/2))
If(t=0)Then
u=3.14159265357979/2
X1=(I1-2*a^(1/2)*Cos(u/3))/3
X2=(I1+a^(1/2)*(Cos(u/3)+3^(1/2)*Sin(u/3)))/3
X3=(I1+a^(1/2)*(Cos(u/3)-3^(1/2)*Sin(u/3)))/3
Else
If(-10)Then
u=Atn((1-t^2)/t)
X1=(I1-2*a^(1/2)*Cos(u/3))/3
X2=(I1+a^(1/2)*(Cos(u/3)+3^(1/2)*Sin(u/3)))/3
X3=(I1+a^(1/2)*(Cos(u/3)-3^(1/2)*Sin(u/3)))/3
EndIf
EndIf
EndIf
'当不全是实根时
If(d>0Ord<0Anda<=0)Then
MsgBox"方程可能不全是实根,无法比较根的大小,请重新输入",vbOKOnly,"温馨提示"
Text13.Text=""
Text14.Text=""
Text15.Text=""
Text16.Text=""
Text17.Text=""
Text18.Text=""
Text13.SetFocus
EndIf
'比较大小,输出主应力(δ1,δ2,δ3)和最大剪应力τmax=τ13=(δ1-δ3)/2以及应力圆
If(X1>=X2AndX2>=X3)Then
Text19.Text=Str(X1)
Text20.Text=Str(X2)
Text21.Text=Str(X3)
Text22.Text=Str((X1-X3)/2)
Picture2.ScaleMode=3
Picture2.Scale(0,0)-(200,80)
Picture2.Scale(-100,40)-(100,-40)
Picture2.Line(-100,0)-(100,0)
Picture2.Line(0,-40)-(0,40)
Picture2.Circle((X1+X2)/2,0),(X1-X2)/2,QBColor(12)
Picture2.Circle((X1+X3)/2,0),(X1-X3)/2,QBColor(12)
Picture2.Circle((X2+X3)/2,0),(X2-X3)/2,QBColor(12)
EndIf
If(X1>=X3AndX3>=X2)Then
Text19.Text=Str(X1)
Text20.Text=Str(X3)
Text21.Text=Str(X2)
Text22.Text=Str((X1-X2)/2)
Picture2.ScaleMode=3
Picture2.Scale(0,0)-(200,80)
Picture2.Scale(-100,40)-(100,-40)
Picture2.Line(-100,0)-(100,0)
Picture2.Line(0,-40)-(0,40)
Picture2.Circle((X1+X2)/2,0),(X1-X2)/2,QBColor(12)
Picture2.Circle((X1+X3)/2,0),(X1-X3)/2,QBColor(12)
Picture2.Circle((X2+X3)/2,0),(X3-X2)/2,QBColor(12)
EndIf
If(X2>=X1AndX1>=X3)Then
Text19.Text=Str(X2)
Text20.Text=Str(X1)
Text21.Text=Str(X3)
Text22.Text=Str((X2-X3)/2)
Picture2.ScaleMode=3
Picture2.Scale(0,0)-(200,80)
Picture2.Scale(-100,40)-(100,-40)
Picture2.Line(-100,0)-(100,0)
Picture2.Line(0,-40)-(0,40)
Picture2.Circle((X1+X2)/2,0),(X2-X1)/2,QBColor(12)
Picture2.Circle((X1+X3)/2,0),(X1-X3)/2,QBColor(12)
Picture2.Circle((X2+X3)/2,0),(X2-X3)/2,QBColor(12)
EndIf
If(X2>=X3AndX3>=X1)Then
Text19.Text=Str(X2)
Text20.Text=Str(X3)
Text21.Text=Str(X1)
Text22.Text=Str((X2-X1)/2)
Picture2.ScaleMode=3
Picture2.Scale(0,0)-(200,80)
Picture2.Scale(-100,40)-(100,-40)
Picture2.Line(-100,0)-(100,0)
Picture2.Line(0,-40)-(0,40)
Picture2.Circle((X1+X2)/2,0),(X2-X1)/2,QBColor(12)
Picture2.Circle((X1+X3)/2,0),(X3-X1)/2,QBColor(12)
Picture2.Circle((X2+X3)/2,0),(X2-X3)/2,QBColor(12)
EndIf
If(X3>=X1AndX1>=X2)Then
Text19.Text=Str(X3)
Text20.Text=Str(X1)
Text21.Text=Str(X2)
Text22.Text=Str((X3-X1)/2)
Picture2.ScaleMode=3
Picture2.Scale(0,0)-(200,80)
Picture2.Scale(-100,40)-(100,-40)
Picture2.Line(-100,0)-(100,0)
Picture2.Line(0,-40)-(0,40)
Picture2.Circle((X1+X2)/2,0),(X1-X2)/2,QBColor(12)
Picture2.Circle((X1+X3)/2,0),(X3-X1)/2,QBColor(12)
Picture2.Circle((X2+X3)/2,0),(X3-X2)/2,QBColor(12)
EndIf
If(X3>=X2AndX2>=X1)Then
Text19.Text=Str(X3)
Text20.Text=Str(X2)
Text21.Text=Str(X1)
Text22.Text=Str((X3-X1)/2)
Picture2.ScaleMode=3
Picture2.Scale(0,0)-(200,80)
Picture2.Scale(-100,40)-(100,-40)
Picture2.Line(-100,0)-(100,0)
Picture2.Line(0,-40)-(0,40)
Picture2.Circle((X1+X2)/2,0),(X2-X1)/2,QBColor(12)
Picture2.Circle((X1+X3)/2,0),(X3-X1)/2,QBColor(12)
Picture2.Circle((X2+X3)/2,0),(X3-X2)/2,QBColor(12)
EndIf
EndSub
PrivateSubCommand2_Click()
'清空文本框
Text13.Text=""
Text14.Text=""
Text15.Text=""
Text16.Text=""
Text17.Text=""
Text18.Text=""
Text19.Text=""
Text20.Text=""
Text21.Text=""
Text22.Text=""
'清除图片框
Picture2.Cls
'返回光标
Text13.SetFocus
EndSub
PrivateSubCommand3_Click()
Me.Hide
Form1.Visible=True
EndSub
PrivateSubCommand4_Click()
Me.Hide
Form4.Visible=True
EndSub
PrivateSubCommand1_Click()
Dimd,u,l,e,tp,ts,a,b,p,n,tAsDouble
Dimi,sAsDouble
Dimr,rp,rsAsDouble
Constpi=3.1415
d=Val(Text1.Text)
u=Val(Text2.Text)
l=Val(Text3.Text)
e=Val(Text4.Text)
tp=Val(Text5.Text)
ts=Val(Text6.Text)
a=Val(Text7.Text)
b=Val(Text8.Text)
p=Val(Text9.Text)
n=Val(Text10.Text)
i=pi*d^4/64
s=pi*d*d/4
r=1000*u*l/Sqr(i/s)
rp=pi*Sqr(e/tp)
rs=(a-ts)/b
Ifr>=rpThen
t=pi^2*e/(r^2*n)
Text11.Text=t
Ifp/s<=tThen
Text12.Text="满足稳定条件"
Else
Text12.Text="不满足稳定条件"
EndIf
ElseIfr>=rsThen
t=(a-b*r)/n
Text11.Text=t
Ifp/s<=tThen
Text12.Text="满足稳定条件"
Else
Text12.Text="不满足稳定条件"
EndIf
Else
Text11.Text=""
Text12.Te