好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

matlab实现简单物理实验模拟资料.doc

5页
  • 卖家[上传人]:w****i
  • 文档编号:102975508
  • 上传时间:2019-10-05
  • 文档格式:DOC
  • 文档大小:20.70KB
  • / 5 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 一. ball.mclear vx=input('please input the speed ration of Vx and Vi:');k=input('coefficient of rebound(<1):'); if k>=1 return,end tm=(1+k)/(1-k); xm=vx*tm; figure plot([0,xm],[0,0],'LineWidth',3) grid on axis equal axis([0,xm,0,1]) title('Trajectoey of ball','FontSize',16)xlabel('horizontal distance(m)','FontSize',16) ylabel('Vertical height(m)','FontSize',16) dt=0.001; tm=1; t=0:dt:tm; x=2*vx*t; y=1-t.^2; i=0; hold on while tm>0.01 comet(x,y) plot(x,y,'LineWidth',2) i=i+1; tm=2*k.^i; t=0:0.001:tm; x=x(end)+2*vx*t; y=2*k^i*t-t.^2; end 二. collision.m clear m=0:0.5:2; n=length(m); theta=0:5:90; th=theta*pi/180; [M,TH]=meshgrid(m,th); PHI=2*asin(sin(TH/2)./(1+M))*180/pi; figure(1) plot(theta,PHI(:,1),'o-',theta,PHI(:,2),'s-',theta,PHI(:,3),'d-',... theta,PHI(:,4),'p-',theta,PHI(:,5),'h-')xlabel('\it\theta\rm/\circ','FontSize',16)ylabel('\it\phi\rm/\circ','FontSize',16)title('Angle of ball and object','FontSize',16)grid on legend([repmat('Ratio of mass\itM/m\rm=',n,1),num2str(m')],2)DE=M./(1+M).*(1-cos(TH)); figure(2) plot(theta,DE(:,1),'o-',theta,DE(:,2),'d-',theta,DE(:,3),'s-',... theta,DE(:,4),'p-',theta,DE(:,5),'h-')xlabel('\it\theta\rm/\circ','FontSize',16)ylabel('\Delta\itE/mgl','FontSize',16) title('Mechanical Energy','FontSize',16)grid on legend([repmat('Ration of mass\itM/m\rm=',n,1),num2str(m')],2)三. niudunhuan.m clear rm=5; r=-rm:0.01:rm; [X,Y]=meshgrid(r); R=sqrt(X.^2+Y.^2); I=cos(pi*(R.^2+1/2)).^2; I(R>rm)=0; c=linspace(0,1,64)'; figure d=image(I*64); %ColorMap([c,c*0,c*0]) %ColorMap([c,c,c*0]) ColorMap([c,c,c]) axis off equal title('Newton ring','FontSize',16) pause h=0; while 1 h=h+0.02; I=cos(pi*(R.^2+1/2+2*h)).^2; I(R>rm)=0; set(d,'CData',64*I) drawnow if get(gcf,'CurrentCharacter')==char(27) break,endend 四. stick.mclear g=10; v0=12; theta=input('angle of incidence:'); th=theta*pi/180; w=10*pi; l=1; m1=0.2; m2=0.3; r1=l*m2/(m1+m2); r2=l*m1/(m1+m2); t0=2*v0*sin(th)/g; n=200; t=linspace(0,t0,n); xc=v0*cos(th)*t; yc=v0*sin(th)*t-g*t.*t/2; x1=xc+r1*cos(w*t); y1=yc+r1*sin(w*t); x2=xc-r2*cos(w*t); y2=yc-r2*sin(w*t); figure h12=plot([x1(1);x2(1)],[y1(1);y2(1)],'-o','LineWidth',6);grid on axis([-0.5,xc(end)+1,-1.5,max(yc)+1]) axis equal title('Motion of lifgt stick','FontSize',16)xlabel('x(m)','FontSize',16) ylabel('y(m)','FontSize',16) hold on pause for i=1:n-1 set(h12,'XData',[x1(i);x2(i)],'YData',[y1(i);y2(i)]); plot([xc(i);xc(i+1)],[yc(i);yc(i+1)],'LineWidth',2) plot([x1(i);x1(i+1)],[y1(i);y1(i+1)],'k') plot([x2(i);x2(i+1)],[y2(i);y2(i+1)],'r') if floor((i-1)/20)==(i-1)/20 plot([x1(i);x2(i)],[y1(i);y2(i)],'L。

      点击阅读更多内容
      相关文档
      新版中华民族共同体概论课件第五讲大一统与中华民族初步形成(秦汉时期)-2025年版.pptx 2023版《思想道德与法治》教学设计-绪论.docx 新版中华民族共同体概论课件第一讲中华民族共同体基础理论-2025年版.pptx 思想道德与法治(2023年版)资料第四章 明确价值要求 践行价值准则 - 副本.docx 2023版教学设计第五章 遵守道德规范 锤炼道德品格思想道德与法治2023版本课件.docx 新版中华民族共同体概论课件第二讲树立正确的中华民族历史观-2025年版.pptx 第六讲践行多边主义完善全球治理讲稿-2025秋形势与政策讲稿.docx 2023版教学设计第四章 明确价值要求 践行价值准则思想道德与法治2023版本课件.docx 新版中华民族共同体概论课件第十六讲文明新路与人类命运共同体-2025年版.pptx 第四讲阔步迈向农业强国讲稿-2025秋形势与政策讲稿.docx 2023版第一章 领悟人生真谛 把握人生方向教学设计思想道德与法治2023版本课件.docx 2023版教学设计第二章 追求远大理想 坚定崇高信念思想道德与法治2023版本课件.docx 微机原理及单片机应用技术概述.ppt 塑料成型工艺与模具结构-塑料成型工艺基础.ppt 市场营销学(第2版)市场营销管理.ppt 税收筹划(第2版)课件:跨国税收筹划问题.ppt 微机原理及单片机应用技术-初识STM32.ppt 政府与非营利组织会计(第7版)课件:政府会计的基本概念.pptx 政府与非营利组织会计(第7版)课件:政府单位会计概述.pptx 银行会计课件:无形资产与其他资产的核算.pptx
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.