matlab曲柄滑块机构的运动学仿真Word文档格式.docx
- 文档编号:13668234
- 上传时间:2022-10-12
- 格式:DOCX
- 页数:8
- 大小:197.01KB
matlab曲柄滑块机构的运动学仿真Word文档格式.docx
《matlab曲柄滑块机构的运动学仿真Word文档格式.docx》由会员分享,可在线阅读,更多相关《matlab曲柄滑块机构的运动学仿真Word文档格式.docx(8页珍藏版)》请在冰豆网上搜索。
2、运动分析3
三、MATLAB程序编写5
四、使用指南和实例仿真8
五、结语10
亠、引言
曲柄滑块机构是指用曲柄和滑块来实现转动和移动相互转换的平面连杆机构,也称曲柄连杆机构。
曲柄滑块机构广泛应用于往复活塞式发动机、压缩机、冲床等的主机构中,把往复移动转换为不整周或整周的回转运动;
压缩机、冲床以曲柄为主动件,把整周转动转换为往复移动。
这里使用运动学知识,对其运动进行解析,并用MATLAE为其设计仿真模块。
1、运动学分析
1、实例题目
对图示单缸四冲程发动机中常见的曲柄滑块机构进行运动学仿真。
已知连杆长度:
D0.1m,r30.4m,连杆的转速:
22,33,
设曲柄r2以匀速旋转,250r/s。
初始条件:
230。
仿真以2为
输入,计算3和A,仿真时间0.5s。
2、运动分析
建立封闭矢量方程:
r2+r3=r1(9)
将(9)式分解到x与y轴坐标上,得到:
r2cos02+r3cos03=r1
r2sin02+r3sin03=0(10)
可得:
r1=r2cos02+r3cos03
.03-arcsin(r2r3)(11)
对(10)式对时间求导得:
-r2w2sin02+3w3sin03=v1
r2w2cos02+3w3cos03=0(12)
将上式用矩阵形式表示,令:
A=[r3sin031
-r3cos030]
X=[w3
v1]
B=[-r2w2sin02
r2w2cos02]
则(12)可表示为:
AX二B(13)
从而可解出w3与v1
、MATLAB程序编写
源代码如下:
functionvarargout=z1(varargin)
%Z1MATLABcodeforz1.fig
%Z1,byitself,createsanewZ1orraisestheexisting
%singleton*.
%
%H=Z1returnsthehandletoanewZ1orthehandleto
%theexistingsingleton*.
%Z1('
CALLBACK'
hObject,eventData,handles,...)callsthelocal
%functionnamedCALLBACKinZ1.Mwiththegiveninputarguments.
Property'
'
Value'
...)createsanewZ1orraisesthe
%existingsingleton*.Startingfromtheleft,propertyvaluepairsare
%appliedtotheGUIbeforez1_OpeningFcngetscalled.An
%unrecognizedpropertynameorinvalidvaluemakespropertyapplication
%stop.Allinputsarepassedtoz1_OpeningFcnviavarargin.
%*SeeGUIOptionsonGUIDE'
sToolsmenu.Choose"
GUIallowsonlyone
%instancetorun(singleton)"
.
%Seealso:
GUIDE,GUIDATA,GUIHANDLES
%Edittheabovetexttomodifytheresponsetohelpz1
%LastModifiedbyGUIDEv2.529-Dec-201622:
57:
13
%Begininitializationcode-DONOTEDITgui_Singleton=1;
gui_State=struct('
gui_Name'
mfilename,...'
gui_Singleton'
gui_Singleton,...'
gui_OpeningFcn'
z1_OpeningFcn,...
ifnargout
[varargout{1:
nargout}]=gui_mainfcn(gui_State,varargin{:
});
else
gui_mainfcn(gui_State,varargin{:
end
%Endinitializationcode-DONOTEDIT
%---Executesjustbeforez1ismadevisible.
functionz1_OpeningFcn(hObject,eventdata,handles,varargin)
%Thisfunctionhasnooutputargs,seeOutputFcn.
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%varargincommandlineargumentstoz1(seeVARARGIN)
%Choosedefaultcommandlineoutputforz1handles.output=hObject;
%Updatehandlesstructureguidata(hObject,handles);
axes(handles.axes3)map1=imread('
1.bmp'
);
imshow(map1)
%UIWAITmakesz1waitforuserresponse(seeUIRESUME)
%uiwait(handles.figure1);
%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=z1_OutputFcn(hObject,eventdata,handles)
%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);
%hObjecthandletofigure
%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;
%---ExecutesonbuttonpressinpushbuttonRun.
functionpushbuttonRun_Callback(hObject,eventdata,handles)%主要计算程序
r2=0.1;
%单位m
r3=0.4;
omiga2=str2double(get(handles.edit1,'
String'
));
;
%单位rad/sx11=1:
500%单位ms
fori=1:
500
theta2(i)=i*omiga2/1000;
theta3(i)=asin(-r2/r3*sin(theta2(i)));
B=[-r2*omiga2*sin(theta2(i));
r2*omiga2*cos(theta2(i))];
A=[r3*sin(theta3(i))1;
-r3*cos(theta3(i))0];
X=inv(A)*B;
omiga3(i)=X(1,1);
v3(i)=X(2,1);
endaxes(handles.axes1)%制表1plot(x11/1000,omiga3);
xlabel('
时间(t/s)'
)
ylabel('
连杆角速度33(rad/s)'
)axes(handles.axes2)%制表2plot(x11/1000,v3);
时间(t/s)'
)ylabel('
滑块速度v1(m/s)'
%hObjecthandletopushbuttonRun(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)functionedit1_Callback(hObject,eventdata,handles)
%hObjecthandletoedit1(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%Hints:
get(hObject,'
)returnscontentsofedit1astext
%str2double(get(hObject,'
))returnscontentsofedit1asadouble
%---Executesduringobjectcreation,aftersettingallproperties.functionedit1_CreateFcn(hObject,eventdata,handles)
%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled
%Hint:
editcontrolsusuallyhaveawhitebackgroundonWindows.
%SeeISPCandCOMPUTER.
ifispc&
&
isequal(get(hObject,'
BackgroundColor'
),get(0,'
defaultUicontrolBackgroundColor'
))set(hObject,'
Back
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- matlab 曲柄 机构 运动学 仿真