资源描述:
《数学建模第三次作业——追击问题.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、数学建模(机自75班)丁鑫070111148数学建模实验报告机械工程及自动化75班07011114丁鑫数学建模(机自75班)丁鑫070111148四人追击问题问题:在一个边长为1的正方形跑道的四个顶点上各站有一人,他们同时开始以等速顺时针追逐下一人,在追逐过程中,每个人时刻对准目标,试模拟追击路线。并讨论:(1)四个人能否追到一起?(2)若能追到一起,则每个人跑过多少路程?(3)追到一起所需要的时间(设速率为1)?(4)如果四个人追逐的速度不一样,情况又如何呢分析:先建立坐标系,设计程序使从A,B,C,D四个点同时出发,画出图形并判
2、断。程序设计流程:四个人追击的速度相等,则有。针对这种情形,可有以下的程序。holdonaxis([0202]);gridA=[0,0];B=[0,1];C=[1,1];D=[1,0];k=0;s1=0;s2=0;s3=0;s4=0;%四个人分别走过的路程t=0;v=1;dt=0.002;whilek<10000k=k+1;plot(A(1),A(2),'r.','markersize',15);plot(B(1),B(2),'b.','markersize',15);plot(C(1),C(2),'m.','markersize'
3、,15);plot(D(1),D(2),'k.','markersize',15);e1=B-A;d1=norm(e1);e2=C-B;d2=norm(e2);e3=D-C;d3=norm(e3);e4=A-D;d4=norm(e4);fprintf('k=%.0f',k)fprintf('A(%.2f,%.2f)d1=%.2f',A(1),A(2),d1)fprintf('B(%.2f,%.2f)d2=%.2f',B(1),B(2),d2)fprintf('C(%.2f,%.2f)d3=%.2f',C(1),C(2),d3)fpr
4、intf('D(%.2f,%.2f)d4=%.2f',D(1),D(2),d4)A=A+v*dt*e1/d1;B=B+v*dt*e2/d2;C=C+v*dt*e3/d3;D=D+v*dt*e4/d4;t=t+dt;数学建模(机自75班)丁鑫070111148s1=s1+v*dt;s2=s2+v*dt;s3=s3+v*dt;s4=s4+v*dt;ifnorm(A-C)<=5.0e-3&norm(B-D)<=5.0e-3breakendendts1s2s3s4数学建模(机自75班)丁鑫070111148数学建模(机自75班)丁鑫07
5、0111148部分运行结果:k=481A(0.52,0.52)d1=0.04B(0.52,0.48)d2=0.04C(0.48,0.48)d3=0.04D(0.48,0.52)d4=0.04k=482A(0.52,0.52)d1=0.04B(0.52,0.48)d2=0.04C(0.48,0.48)d3=0.04D(0.48,0.52)d4=0.04k=483A(0.52,0.52)d1=0.04B(0.52,0.48)d2=0.04C(0.48,0.48)d3=0.04D(0.48,0.52)d4=0.04k=484A(0.52,
6、0.51)d1=0.04B(0.51,0.48)d2=0.04C(0.48,0.49)d3=0.04D(0.49,0.52)d4=0.04k=485A(0.52,0.51)d1=0.04B(0.51,0.48)d2=0.04C(0.48,0.49)d3=0.04D(0.49,0.52)d4=0.04k=486A(0.52,0.51)d1=0.03B(0.51,0.48)d2=0.03C(0.48,0.49)d3=0.03D(0.49,0.52)d4=0.03k=487A(0.52,0.51)d1=0.03B(0.51,0.48)d2
7、=0.03C(0.48,0.49)d3=0.03D(0.49,0.52)d4=0.03k=488A(0.52,0.51)d1=0.03B(0.51,0.48)d2=0.03C(0.48,0.49)d3=0.03D(0.49,0.52)d4=0.03k=489A(0.52,0.51)d1=0.03B(0.51,0.48)d2=0.03C(0.48,0.49)d3=0.03D(0.49,0.52)d4=0.03k=490A(0.52,0.50)d1=0.03B(0.50,0.48)d2=0.03C(0.48,0.50)d3=0.03D(
8、0.50,0.52)d4=0.03k=491A(0.52,0.50)d1=0.02B(0.50,0.48)d2=0.02C(0.48,0.50)d3=0.02D(0.50,0.52)d4=0.02k=492A(0.52,0.50)d1