数学建模第三次作业——追击问题(共8页).doc
《数学建模第三次作业——追击问题(共8页).doc》由会员分享,可在线阅读,更多相关《数学建模第三次作业——追击问题(共8页).doc(8页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上数学建模实验报告机械工程及自动化75班丁鑫四人追击问题问题:在一个边长为1的正方形跑道的四个顶点上各站有一人,他们同时开始以等速顺时针追逐下一人,在追逐过程中,每个人时刻对准目标,试模拟追击路线。并讨论:(1) 四个人能否追到一起?(2)若能追到一起,则每个人跑过多少路程?(3)追到一起所需要的时间(设速率为1)?(4)如果四个人追逐的速度不一样,情况又如何呢分析:先建立坐标系,设计程序使从A,B,C,D四个点同时出发,画出图形并判断。程序设计流程:四个人追击的速度相等,则有。针对这种情形,可有以下的程序。hold onaxis(0 2 0 2);gridA=0,0;
2、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;while k10000 k=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,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=no
3、rm(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) fprintf(D(%.2f,%.2f) d4=%.2fn,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; s1=s1+v*dt; s2=s2+v*dt; s
4、3=s3+v*dt; s4=s4+v*dt; if norm(A-C)=5.0e-3&norm(B-D)=5.0e-3 break endendts1s2s3s4部分运行结果:k=481 A(0.52,0.52) d1=0.04 B(0.52,0.48) d2=0.04 C(0.48,0.48) d3=0.04 D(0.48,0.52) d4=0.04k=482 A(0.52,0.52) d1=0.04 B(0.52,0.48) d2=0.04 C(0.48,0.48) d3=0.04 D(0.48,0.52) d4=0.04k=483 A(0.52,0.52) d1=0.04 B(0.52,
5、0.48) d2=0.04 C(0.48,0.48) d3=0.04 D(0.48,0.52) d4=0.04k=484 A(0.52,0.51) d1=0.04 B(0.51,0.48) d2=0.04 C(0.48,0.49) d3=0.04 D(0.49,0.52) d4=0.04k=485 A(0.52,0.51) d1=0.04 B(0.51,0.48) d2=0.04 C(0.48,0.49) d3=0.04 D(0.49,0.52) d4=0.04k=486 A(0.52,0.51) d1=0.03 B(0.51,0.48) d2=0.03 C(0.48,0.49) d3=0.0
6、3 D(0.49,0.52) d4=0.03k=487 A(0.52,0.51) d1=0.03 B(0.51,0.48) d2=0.03 C(0.48,0.49) d3=0.03 D(0.49,0.52) d4=0.03k=488 A(0.52,0.51) d1=0.03 B(0.51,0.48) d2=0.03 C(0.48,0.49) d3=0.03 D(0.49,0.52) d4=0.03k=489 A(0.52,0.51) d1=0.03 B(0.51,0.48) d2=0.03 C(0.48,0.49) d3=0.03 D(0.49,0.52) d4=0.03k=490 A(0.5
7、2,0.50) d1=0.03 B(0.50,0.48) d2=0.03 C(0.48,0.50) d3=0.03 D(0.50,0.52) d4=0.03k=491 A(0.52,0.50) d1=0.02 B(0.50,0.48) d2=0.02 C(0.48,0.50) d3=0.02 D(0.50,0.52) d4=0.02k=492 A(0.52,0.50) d1=0.02 B(0.50,0.48) d2=0.02 C(0.48,0.50) d3=0.02 D(0.50,0.52) d4=0.02k=493 A(0.51,0.50) d1=0.02 B(0.50,0.49) d2=0
8、.02 C(0.49,0.50) d3=0.02 D(0.50,0.51) d4=0.02k=494 A(0.51,0.50) d1=0.02 B(0.50,0.49) d2=0.02 C(0.49,0.50) d3=0.02 D(0.50,0.51) d4=0.02k=495 A(0.51,0.50) d1=0.02 B(0.50,0.49) d2=0.02 C(0.49,0.50) d3=0.02 D(0.50,0.51) d4=0.02k=496 A(0.51,0.50) d1=0.01 B(0.50,0.49) d2=0.01 C(0.49,0.50) d3=0.01 D(0.50,0
9、.51) d4=0.01k=497 A(0.51,0.49) d1=0.01 B(0.49,0.49) d2=0.01 C(0.49,0.51) d3=0.01 D(0.51,0.51) d4=0.01k=498 A(0.51,0.49) d1=0.01 B(0.49,0.49) d2=0.01 C(0.49,0.51) d3=0.01 D(0.51,0.51) d4=0.01k=499 A(0.50,0.49) d1=0.01 B(0.49,0.50) d2=0.01 C(0.50,0.51) d3=0.01 D(0.51,0.50) d4=0.01k=500 A(0.50,0.50) d1
10、=0.01 B(0.50,0.50) d2=0.01 C(0.50,0.50) d3=0.01 D(0.50,0.50) d4=0.01k=501 A(0.50,0.50) d1=0.01 B(0.50,0.50) d2=0.01 C(0.50,0.50) d3=0.01 D(0.50,0.50) d4=0.01k=502 A(0.50,0.50) d1=0.00 B(0.50,0.50) d2=0.00 C(0.50,0.50) d3=0.00 D(0.50,0.50) d4=0.00t = 1.0040s1 = 1.0040s2 = 1.0040s3 = 1.0040s4 =1.0040从
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数学 建模 第三次 作业 追击 问题
限制150内