冻季也 发表于 2004-4-22 00:18:39

一个数学建模题

一慢跑者沿着他喜欢的路线跑步,有只狗看见他了,就追他,求狗的路线。

aquila_free 发表于 2004-4-25 23:50:38

不要到处都灌水啊,有了呀

paradiseboy 发表于 2004-4-28 16:34:48

<FONT color=#555555>%书上的一个程序,描述一只狗追一名慢跑者的运动轨迹 </FONT><P>global w;
y0=;   % initial conditions, starting point of the dog
w=10;         % w speed of the dog
options=odeset('RelTol',1e-5,'Events','on');
=ode23('dog',,y0,options); <P>J=[];
for h=1:length(t)
   w=jogger(t(h));
   J=;
end <P>xmin=min(min(Y(:,1)),min(J(:,1)));
xmax=max(max(Y(:,1)),max(J(:,1)));
ymin=min(min(Y(:,2)),min(J(:,2)));
ymax=max(max(Y(:,2)),max(J(:,2))); <P>clf;
hold on
axis();
axis equal
title('The jogger and the Dog') <P>for h=1:length(t)-1
   plot(,,'-',...
       'color','r','EraseMode','none');
   plot(,,':',...
       'color','green','EraseMode','none');
   drawnow
   pause(0.1);
end
hold off <P>%%%%%%%%%%%%%% <P>function s=jogger(t) <P>s=; <P>%%%%%%%%%%%%%% <P>function =dog(t,z,flag); <P>global w% w=speed of the dog
X=jogger(t);
h=X-z;
nh=norm(h);
if nargin&lt;3 | isempty(flag)   % normal output
   zs=(w/nh)*h;
else
   switch(flag)
       case 'events'   % at norm(h)=0 there is a singularity
         zs=nh-1e-3; % zero crossing at pos_dog=pos_jogger
         isterminal=1;% this is a stopping event
         direction=0; % don't care if decrease or increase
       otherwise
         error(['Unknown flag:' flag]);
   end
end

paradiseboy 发表于 2004-4-28 16:36:47

<P>http://bbs.jzit.edu.cn/jzitbbs/usr/24/24_69_15.gif</P>
<P>
<TABLEheight=70 cellSpacing=0 cellPadding=0 width="100%">

<TR vAlign=top>
<TD ><FONT color=#333333>程序中用到ode23函数,解微分方程。 </FONT></TD></TR></TABLE></P>

wzp1984 发表于 2004-5-1 08:32:11

lap!

鬼鬼 发表于 2005-5-5 22:20:13

书上有

aa7472888 发表于 2005-8-25 00:57:30

高中书上就有了,自己去看啊~~

chl_0410 发表于 2005-8-29 00:43:52

<P>晕倒呀,,都有啦,,还在这说,,真是的,,不像话,,来个像样的呀,</P>
页: [1]
查看完整版本: 一个数学建模题