完全弹性碰撞matlabWord下载.docx

上传人:b****4 文档编号:7260106 上传时间:2023-05-08 格式:DOCX 页数:11 大小:95.04KB
下载 相关 举报
完全弹性碰撞matlabWord下载.docx_第1页
第1页 / 共11页
完全弹性碰撞matlabWord下载.docx_第2页
第2页 / 共11页
完全弹性碰撞matlabWord下载.docx_第3页
第3页 / 共11页
完全弹性碰撞matlabWord下载.docx_第4页
第4页 / 共11页
完全弹性碰撞matlabWord下载.docx_第5页
第5页 / 共11页
完全弹性碰撞matlabWord下载.docx_第6页
第6页 / 共11页
完全弹性碰撞matlabWord下载.docx_第7页
第7页 / 共11页
完全弹性碰撞matlabWord下载.docx_第8页
第8页 / 共11页
完全弹性碰撞matlabWord下载.docx_第9页
第9页 / 共11页
完全弹性碰撞matlabWord下载.docx_第10页
第10页 / 共11页
完全弹性碰撞matlabWord下载.docx_第11页
第11页 / 共11页
亲,该文档总共11页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

完全弹性碰撞matlabWord下载.docx

《完全弹性碰撞matlabWord下载.docx》由会员分享,可在线阅读,更多相关《完全弹性碰撞matlabWord下载.docx(11页珍藏版)》请在冰点文库上搜索。

完全弹性碰撞matlabWord下载.docx

%定义图中方框的宽度

baseh=2.3;

%定义图中方框的高度

instant=0.2;

%定义摆线间距

%三视图的初始设置

%第一幅图

figure('

name'

'

理想情况下能量守恒定律1'

position'

[500,340,440,320]);

%定义第一幅图的标题和位置

fill([xmax,xmax,-xmax,-xmax,xmax,xmax-0.05,xmax-0.05,-xmax+0.05,-xmax+0.05,xmax-0.05],[ymax,-ymax,-ymax,ymax,ymax,ymax-0.05,-ymax+0.05,-ymax+0.05,ymax-0.05,ymax-0.05],[0,1,1]);

%填充底座背景

holdon;

%保持当前图形及坐标所有特性

fill([xmax-0.05,xmax-0.05,-xmax+0.05,-xmax+0.05],[ymax-0.5,ymax-0.55,ymax-0.55,ymax-0.5],'

g'

);

%填充方框内横杆背景

holdon;

text(-0.25,1.7,'

1'

text(0,1.7,'

2'

text(0.25,1.7,'

3'

%在坐标处标识说明文字

text(-1.0,1.7,'

a'

text(-1.0,-1.7,'

b'

text(1.0,1.7,'

真空容器'

text(-1.8,1.7,'

主视图'

axis([-basew,basew,-baseh,baseh]);

%定义背景坐标范围在x(-2.3~2.3)Y(-2.3~2.3)之间

%axis('

off'

%覆盖坐标刻度并填充背景

theta0=7*pi/6;

%摆线1的初始角度

x0=pole*cos(theta0);

%摆线1末端x坐标

y0=pole*sin(theta0)+1.5;

%摆线1末端y坐标

body1=line([-instant,x0-instant],[1.5,y0],'

color'

r'

linestyle'

-'

erasemode'

xor'

%设置摆线1

head1=line(x0-instant,y0,'

.'

markersize'

40);

%设置第一个小球颜色,大小

theta1=3*pi/2;

%摆线2,3的角度

x1=pole*cos(theta1);

%摆线2,3末端x坐标

y1=pole*sin(theta1)+1.5;

%摆线2,3末端y坐标

body=line([-0.001,x1],[1.5,y1],'

k'

%设置摆线2

head=line(x1,y1,'

%设置第2个小球颜色,大小

body2=line([instant;

x1+instant],[1.5;

y1],'

%设置摆线3

head2=line(x1+instant,y1,'

%设置第3个小球颜色,大小

theta3=15*pi/6;

%第二幅图

理想情况下能量守恒定律2'

[500,40,440,320]);

%填充底座背景

%填充方框内第一根横杆背景

fill([xmax-0.05,xmax-0.05,-xmax+0.05,-xmax+0.05],[-ymax+0.55,-ymax+0.5,-ymax+0.5,-ymax+0.55],'

%填充方框内第二根横杆背景

俯视图'

y01=0;

%设置摆球纵坐标值

body11=line([-instant,x0-instant],[1.5,y01],'

%设置摆线1上摆线

body12=line([-instant,x0-instant],[-1.5,y01],'

%设置摆线1下摆线

head01=line(x0-instant,y01,'

body01=line([-0.001,x1],[1.5,y01],'

%设置摆线2上摆线

body02=line([-0.001,x1],[-1.5,y01],'

%设置摆线2下摆线

head00=line(x1,y01,'

%设置第二个小球颜色,大小

body21=line([instant;

y01],'

%设置摆线3上摆线

body22=line([instant;

x1+instant],[-1.5;

%设置摆线3下摆线

head02=line(x1+instant,y01,'

%设置第三个小球颜色,大小

%第三幅图

理想情况下能量守恒定律3'

[50,340,440,320]);

%定义第三幅图的标题和位置

%填充底座背景

holdon%保持当前图形及坐标所有特性

侧视图'

text(-1.7,1.5,'

text(1.7,1.5,'

x01=0;

x02=1.48;

y02=1.48;

%设置坐标

head000=line(-x02,y02,'

18);

%设置横杆a

head000=line(x02,y02,'

%设置横杆b

body311=line([-x02,x01],[y02,y0],'

body312=line([x02,x01],[y02,y0],'

head301=line(x01,y0,'

%设置摆球1

body301=line([-x02,x01],[y02,y1],'

body302=line([x02,x01],[y02,y1],'

head300=line(x01,y1,'

%设置摆球2

body321=line([-x02;

x01],[y02;

body322=line([x02;

head302=line(x01,y1,'

%设置摆球3

while1%条件判断

theta0=theta0+pi/540;

theta3=theta3-pi/540;

iftheta0>

=15*pi/6

theta0=7*pi/6;

theta3=15*pi/6;

%设置摆球1运动过程

elseif(theta0>

=7*pi/6)&

(theta0<

3*pi/2)

x11=pole*cos(theta0);

y11=pole*sin(theta0)+1.5;

set(body1,'

xdata'

[-instant,x11-instant],'

ydata'

[1.5,y11]);

%设置主视图中摆线1运动

set(head1,'

x11-instant,'

y11);

%设置主视图中摆球1运动

set(body11,'

[1.5,y01]);

%设置俯视图中摆线1上摆线运动

set(body12,'

%设置俯视图中摆线1下摆线运动

set(head01,'

y01);

%设置俯视图中摆球1运动

set(body311,'

[-x02,x01],'

[y02,y11]);

%设置侧视图中摆线1上摆线运动

set(body312,'

[x02,x01],'

%设置侧视图中摆线1下摆线运动

set(head301,'

x01,'

%设置侧视图中摆球1运动

%设置摆球3运动的过程

=3*pi/2)&

11*pi/6)

x22=pole*cos(theta0);

y22=pole*sin(theta0)+1.5;

set(body2,'

[instant,x22+instant],'

[1.5,y22]);

%设置主视图中摆线3运动

set(head2,'

x22+instant,'

y22);

%设置主视图中摆球3运动

set(body21,'

%设置俯视图中摆线3上摆线运动

set(body22,'

[-1.5,y01]);

%设置俯视图中摆线3下摆线运动

set(head02,'

%设置俯视图中摆球3运动

set(body321,'

[y02,y22]);

%设置侧视图中摆线3上摆线运动

set(body322,'

%设置侧视图中摆线3下摆线运动

set(head302,'

%设置侧视图中摆球3运动

%设置摆球3运动过程

=11*pi/6)&

=13*pi/6)

x32=pole*cos(theta3);

y32=pole*sin(theta3)+1.5;

[instant,x32+instant],'

[1.5,y32]);

x32+instant,'

y32);

[y02,y32]);

=13*pi/6)&

15*pi/6)

x41=pole*cos(theta3);

y41=pole*sin(theta3)+1.5;

[-instant,x41-instant],'

[1.5,y41]);

x41-instant,'

y41);

[y02,y41]);

%设置侧视图中摆球1运动

drawnow;

end

四.程序截图

主视图

俯视图

侧视图

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2