View Full Version : Cats chasing each other
I am totally stuck on this problem and really don't even know where to begin. So if someone could point me in the right direction it would be greatly appreciated.
Q. Four cats are in four corners of a square room of unitary base. At time t=0 they start chasing each other at unitary velocity, so that cat #1 runs in the direction of cat #2, #2 in the direction of #3, #3 in the direction of #4, and #4 in the direction of #1 untill they meet in the center of the room. Compute and plot the trajectories of the cats using Matlab. :confused: :cry:
stunner5000pt
Nov14-04, 06:23 PM
wouln't it jus make a circle??
Gokul43201
Nov14-04, 06:29 PM
The trajectories will not be circular...I believe they are spirals.
Here's a similar problem (http://www.physicsforums.com/showthread.php?t=26204&highlight=relative+velocity) with solution.
Thanks for the link to the similar problem. That looks very promising as far as establishing the position vectors. I am attatching a pdf image of what the plot is supposed to look like. However I still don't know how to go about tackling this in Matlab. My instructor seems to believe that the whole class is well versed in Matlab even though we have had no formal training on it.
You could just plot the trajectories
r = r_0 e^{-(\theta - \theta_0)}
unless your instructor wants you to use MatLab to solve the differential equations.
That is exactly what he wants.
That is exactly what he wants.
In that case, exploit the symmetry of the problem. At any instant, each cat will be exactly the same distance from each other - and from the center! Also, their "angular coordinates" will be \pi /2 out of phase with each other from one to the next.
With constant speed, v, the equations of motion become
\frac {d}{dt} R \cos \theta = - \frac {v}{\sqrt 2} (\sin \theta + \cos \theta)
and
\frac {d}{dt} R \sin \theta = \frac {v}{\sqrt 2}(\cos \theta - \sin \theta)
You can have MatLab solve these equations for you but if you want the full solution you can expand the derivatives and with a little algebra you should arrive at
\frac {dR}{dt} = - \frac {v}{\sqrt 2}
and
R \frac {d \theta}{dt} = \frac {v}{\sqrt 2}
and the rest is straightforward.
While I understand the mathmatics involved I simply don't know how to enter the equation you have listed above in matlab. I've been tinkering with it for the past hour.
I'm sorry - I don't use MatLab so I can't help you with the specifics of that package.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.