matlab曲柄滑块机构运动学仿真.docx

上传人:m**** 文档编号:546014260 上传时间:2023-06-25 格式:DOCX 页数:11 大小:55.06KB
返回 下载 相关 举报
matlab曲柄滑块机构运动学仿真.docx_第1页
第1页 / 共11页
matlab曲柄滑块机构运动学仿真.docx_第2页
第2页 / 共11页
matlab曲柄滑块机构运动学仿真.docx_第3页
第3页 / 共11页
matlab曲柄滑块机构运动学仿真.docx_第4页
第4页 / 共11页
matlab曲柄滑块机构运动学仿真.docx_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《matlab曲柄滑块机构运动学仿真.docx》由会员分享,可在线阅读,更多相关《matlab曲柄滑块机构运动学仿真.docx(11页珍藏版)》请在金锄头文库上搜索。

1、matlab曲柄滑块机构运动学仿真系统仿真与matlab综合试题/10题目:曲柄滑块机构的运动学仿真编号:21难度系数:姓名班级学号联系方式成绩系统仿真与matlab综合试题1一、前言3二、运动学分析3、实例题目3、运动分析3三、MATLAB程序编写5四、使用指南和实例仿真8五、结语10一、前言曲柄滑块机构是指用曲柄和滑块来实现转动和挪动互相变换的平面连杆机构,也称曲柄连杆机构。曲柄滑块机构广泛应用于来去生塞式发动机、压缩机、冲床等的主机构中,把来去挪动变换为不整周或整周的辗转运动;压缩机、冲床以曲柄为主动件,把整周转动变换为来去挪动。这里使用运动学知识,对其运动进行分析,并用为其设计仿真模块

2、。二、运动学分析、实例题目对图示单缸四冲程发动机中常有的曲柄滑块机构进行运动学仿真。已知连杆长度:r20.1mr0.4m,连杆的转速:22,3,3设曲柄r2以匀速旋转,250r/s。初始条件:230。仿真以输入,计算3和r1,仿真时间0.5s。,为、运动分析建立封闭矢量方程:r2+r3=r1(9)将(9)式分解到x与y轴坐标上,获得:r2cos2+r3cos3=r1r2sin2+r3sin3=0(10)可得:r1=r2cos2+r3cos33=-arcsin(r2/r3)(11)对(10)式对时间求导得:-r22sin2+r33sin3=v1r22cos2+r33cos3=0(12)将上式用矩

3、阵形式表示,令:A=r3sin31-r3cos30X=3v1B=-r22sin2r22cos2则(12)可表示为:AX=B。(13)从而可解出3与v1。三、MATLAB程序编写源代码以下:functionvarargout=z1(varargin)Z1MATLABcodeforz1.figZ1,byitself,createsanewZ1orraisestheexistingsingleton*.%H=Z1returnsthehandletoanewZ1orthehandletotheexistingsingleton*.%Z1(CALLBACK,hObject,eventData,handl

4、es,.)callsthelocalfunctionnamedCALLBACKinZ1.Mwiththegiveninputarguments.Z1(Property,Value,.)createsanewZ1orraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsareappliedtotheGUIbeforez1_OpeningFcngetscalled.Anunrecognizedpropertynameorinvalidvaluemakespropertyapplicationstop.Allinputs

5、arepassedtoz1_OpeningFcnviavarargin.%*SeeGUIOptionsonGUIDEsToolsmenu.ChooseGUIallowsonlyoneinstancetorun(singleton).%Seealso:GUIDE,GUIDATA,GUIHANDLESEdittheabovetexttomodifytheresponsetohelpz1LastModifiedbyGUIDEv2.529-Dec-201622:57:13Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct(

6、gui_Name,mfilename,.gui_Singleton,gui_Singleton,.gui_OpeningFcn,z1_OpeningFcn,.gui_OutputFcn,z1_OutputFcn,.gui_LayoutFcn,.gui_Callback,);ifnargin&ischar(varargin1)gui_State.gui_Callback=str2func(varargin1);endifnargoutvarargout1:nargout=gui_mainfcn(gui_State,varargin:);elsegui_mainfcn(gui_State,vara

7、rgin:);endEndinitializationcode-DONOTEDIT-Executesjustbeforez1ismadevisible.functionz1_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDAT

8、A)%varargincommandlineargumentstoz1(seeVARARGIN)Choosedefaultcommandlineoutputforz1handles.output=hObject;Updatehandlesstructureguidata(hObject,handles);axes(handles.axes3)map1=imread(1.bmp);imshow(map1)UIWAITmakesz1waitforuserresponse(seeUIRESUME)uiwait(handles.figure1);-Outputsfromthisfunctionarer

9、eturnedtothecommandline.functionvarargout=z1_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)Getdefaultcommandlineoutputfromhandl

10、esstructurevarargout1=handles.output;-ExecutesonbuttonpressinpushbuttonRun.functionpushbuttonRun_Callback(hObject,eventdata,handles)%主要计算程序r2=0.1;%单位mr3=0.4;%单位momiga2=str2double(get(handles.edit1,String);%单位rad/sx11=1:500%单位msfori=1:500theta2(i)=i*omiga2/1000;theta3(i)=asin(-r2/r3*sin(theta2(i);B=-

11、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(连杆角速度3(rad/s))axes(handles.axes2)%制表2plot(x11/1000,v3);xlabel(时间(t/s))ylabel(滑块速度v1(m/s))%hObjecthandl

12、etopushbuttonRun(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)functionedit1_Callback(hObject,eventdata,handles)%hObjecthandletoedit1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserda

13、ta(seeGUIDATA)%Hints:get(hObject,String)returnscontentsofedit1astext%str2double(get(hObject,String)returnscontentsofedit1asadouble-Executesduringobjectcreation,aftersettingallproperties.functionedit1_CreateFcn(hObject,eventdata,handles)%hObjecthandletoedit1(seeGCBO)%eventdatareserved-tobedefinedinaf

14、utureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalledHint:editcontrolsusuallyhaveawhitebackgroundonWindows.SeeISPCandCOMPUTER.ifispc&isequal(get(hObject,BackgroundColor),get(0,defaultUicontrolBackgroundColor)set(hObject,BackgroundColor,white);end%-ExecutesonbuttonpressinpushbuttonExit.functionpushbuttonExit_Callback(hObject,eventdata,handles)ss=questdlg(确认退出?,退出信息窗口!,连续仿真!,退出仿真!,退出仿真!);switchsscase退出仿真!delete(handles.figure1);end%hObjecthandletopushbuttonExit(seeGCBO)%eventdatareserved-tobedefinedinafuturever

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号