哈工大材料力学上机大作业.docx
《哈工大材料力学上机大作业.docx》由会员分享,可在线阅读,更多相关《哈工大材料力学上机大作业.docx(39页珍藏版)》请在冰豆网上搜索。
哈工大材料力学上机大作业
材料力学上机大作业
题目名称:
应力状态分析
班号:
学号:
姓名:
应力状态分析
一、问题的提出
该程序可以解决的问题:
①平面应力状态,已知σx,σy,τxy和角度的情况下计算不同任意截面的应力分量,还可以计算平面应力状态主应力的大小和方向并能画出应力圆;②空间应力状态,已知σx,σy,σz,τxy等的情况下计算主应力和最大切应力,并能画出应力圆。
二、数学模型
1、平面应力状态任一斜截面上既有正应力又有切应力,公式为:
2、平面应力状态主应力大小及方向
主应力计算公式
主平面方位计算公式
3、最大切应力:
最大切应力发生在与主平面夹45度角的平面方位。
其公式
4、应力圆
应力圆方程:
圆心:
半径:
5、三向应力状态
三向应力计算公式:
特征方程:
三个不变量
三、程序流程图
㈠平面应力计算
打开界面选择平面应力状态分析输入σx,σy,τxy和角度点击计算可计算出任意截面的应力分量以及三个主应力,主方向角和最大切应力,画出应力圆点击清除数据可进行重复计算
㈡空间应力状态计算
打开界面选择空间应力状态分析输入σx,σy,σz,τxy,τyz,τxz计算出三个主应力及最大切应力和应力圆
点击清除数据可以重复计算
四、程序源代码
1.主界面(lzd.m):
functionvarargout=lzd(varargin)
%LZDMATLABcodeforlzd.fig
%LZD,byitself,createsanewLZDorraisestheexisting
%singleton*.
%
%H=LZDreturnsthehandletoanewLZDorthehandleto
%theexistingsingleton*.
%
%LZD('CALLBACK',hObject,eventData,handles,...)callsthelocal
%functionnamedCALLBACKinLZD.Mwiththegiveninputarguments.
%
%LZD('Property','Value',...)createsanewLZDorraisesthe
%existingsingleton*.Startingfromtheleft,propertyvaluepairsare
%appliedtotheGUIbeforelzd_OpeningFcngetscalled.An
%unrecognizedpropertynameorinvalidvaluemakespropertyapplication
%stop.Allinputsarepassedtolzd_OpeningFcnviavarargin.
%
%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone
%instancetorun(singleton)".
%
%Seealso:
GUIDE,GUIDATA,GUIHANDLES
%Edittheabovetexttomodifytheresponsetohelplzd
%LastModifiedbyGUIDEv2.519-Jun-201322:
04:
01
%Begininitializationcode-DONOTEDIT
gui_Singleton=1;
gui_State=struct('gui_Name',mfilename,...
'gui_Singleton',gui_Singleton,...
'gui_OpeningFcn',@lzd_OpeningFcn,...
'gui_OutputFcn',@lzd_OutputFcn,...
'gui_LayoutFcn',[],...
'gui_Callback',[]);
ifnargin&&ischar(varargin{1})
gui_State.gui_Callback=str2func(varargin{1});
end
ifnargout
[varargout{1:
nargout}]=gui_mainfcn(gui_State,varargin{:
});
else
gui_mainfcn(gui_State,varargin{:
});
end
%Endinitializationcode-DONOTEDIT
%---Executesjustbeforelzdismadevisible.
functionlzd_OpeningFcn(hObject,eventdata,handles,varargin)
%Thisfunctionhasnooutputargs,seeOutputFcn.
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%varargincommandlineargumentstolzd(seeVARARGIN)
%Choosedefaultcommandlineoutputforlzd
handles.output=hObject;
%Updatehandlesstructure
guidata(hObject,handles);
%UIWAITmakeslzdwaitforuserresponse(seeUIRESUME)
%uiwait(handles.figure1);
%---Outputsfromthisfunctionarereturnedtothecommandline.
functionvarargout=lzd_OutputFcn(hObject,eventdata,handles)
%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%Getdefaultcommandlineoutputfromhandlesstructure
varargout{1}=handles.output;
%---Executesonbuttonpressinpushbutton1.
functionpushbutton1_Callback(hObject,eventdata,handles);
close(lzd);
pingmian;
%hObjecthandletopushbutton1(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%---Executesonbuttonpressinpushbutton2.
functionpushbutton2_Callback(hObject,eventdata,handles)
close(lzd);
kongjian;
%hObjecthandletopushbutton2(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%---Executesonbuttonpressinpushbutton3.
functionpushbutton3_Callback(hObject,eventdata,handles)
close(lzd);
%hObjecthandletopushbutton3(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%---Executesduringobjectdeletion,beforedestroyingproperties.
functionfigure1_DeleteFcn(hObject,eventdata,handles)
%hObjecthandletofigure1(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%---Executesonbuttonpressinpushbutton5.
functionpushbutton5_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton5(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
close(lzd);
zuozhexinxi;
2、平面应力状态分析(pingmian.m)
functionvarargout=pingmian(varargin)
%PINGMIANMATLABcodeforpingmian.fig
%PINGMIAN,byitself,createsanewPINGMIANorraisestheexisting
%singleton*.
%
%H=PINGMIANreturnsthehandletoanewPINGMIANorthehandleto
%theexistingsingleton*.
%
%PINGMIAN('CALLBACK',hObject,eventData,handles,...)callsthelocal
%functionnamedCALLBACKinPINGMIAN.Mwiththegiveninputarguments.
%
%PINGMIAN('Property','Value',...)createsanewPINGMIANorraisesthe
%existingsingleton*.Startingfromtheleft,propertyvaluepairsare
%appliedtotheGUIbeforepingmian_OpeningFcngetscalled.An
%unrecognizedpropertynameorinvalidvaluemakespropertyapplication
%stop.Allinputsarepassedtopingmian_OpeningFcnviavarargin.
%
%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone
%instancetorun(singleton)".
%
%Seealso:
GUIDE,GUIDATA,GUIHANDLES
%Edittheabovetexttomodifytheresponsetohelppingmian
%LastModifiedbyGUIDEv2.519-Jun-201321:
28:
55
%Begininitializationcode-DONOTEDIT
gui_Singleton=1;
gui_State=struct('gui_Name',mfilename,...
'gui_Singleton',gui_Singleton,...
'gui_OpeningFcn',@pingmian_OpeningFcn,...
'gui_OutputFcn',@pingmian_OutputFcn,...
'gui_LayoutFcn',[],...
'gui_Callback',[]);
ifnargin&&ischar(varargin{1})
gui_State.gui_Callback=str2func(varargin{1});
end
ifnargout
[varargout{1:
nargout}]=gui_mainfcn(gui_State,varargin{:
});
else
gui_mainfcn(gui_State,varargin{:
});
end
%Endinitializationcode-DONOTEDIT
%---Executesjustbeforepingmianismadevisible.
functionpingmian_OpeningFcn(hObject,eventdata,handles,varargin)
%Thisfunctionhasnooutputargs,seeOutputFcn.
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%varargincommandlineargumentstopingmian(seeVARARGIN)
%Choosedefaultcommandlineoutputforpingmian
handles.output=hObject;
%Updatehandlesstructure
guidata(hObject,handles);
%UIWAITmakespingmianwaitforuserresponse(seeUIRESUME)
%uiwait(handles.figure1);
%---Outputsfromthisfunctionarereturnedtothecommandline.
functionvarargout=pingmian_OutputFcn(hObject,eventdata,handles)
%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%Getdefaultcommandlineoutputfromhandlesstructure
varargout{1}=handles.output;
functionedit1_Callback(hObject,eventdata,handles)
%hObjecthandletoedit1(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%Hints:
get(hObject,'String')returnscontentsofedit1astext
%str2double(get(hObject,'String'))returnscontentsofedit1asadouble
%---Executesduringobjectcreation,aftersettingallproperties.
functionedit1_CreateFcn(hObject,eventdata,handles)
%hObjecthandletoedit1(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled
%Hint:
editcontrolsusuallyhaveawhitebackgroundonWindows.
%SeeISPCandCOMPUTER.
ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
functionedit2_Callback(hObject,eventdata,handles)
%hObjecthandletoedit2(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%Hints:
get(hObject,'String')returnscontentsofedit2astext
%str2double(get(hObject,'String'))returnscontentsofedit2asadouble
%---Executesduringobjectcreation,aftersettingallproperties.
functionedit2_CreateFcn(hObject,eventdata,handles)
%hObjecthandletoedit2(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled
%Hint:
editcontrolsusuallyhaveawhitebackgroundonWindows.
%SeeISPCandCOMPUTER.
ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
functionedit3_Callback(hObject,eventdata,handles)
%hObjecthandletoedit3(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%Hints:
get(hObject,'String')returnscontentsofedit3astext
%str2double(get(hObject,'String'))returnscontentsofedit3asadouble
%---Executesduringobjectcreation,aftersettingallproperties.
functionedit3_CreateFcn(hObject,eventdata,handles)
%hObjecthandletoedit3(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesempty