# Cats chasing each other

1. Nov 14, 2004

### boob

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.

2. Nov 14, 2004

### boob

Can anyone help?

3. Nov 14, 2004

### stunner5000pt

wouln't it jus make a circle??

4. Nov 14, 2004

### Gokul43201

Staff Emeritus
The trajectories will not be circular...I believe they are spirals.

Here's a similar problem with solution.

5. Nov 14, 2004

### boob

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.

Last edited: Nov 14, 2004
6. Nov 14, 2004

### Tide

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.

7. Nov 14, 2004

### boob

That is exactly what he wants.

8. Nov 14, 2004

### Tide

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.

9. Nov 14, 2004

### boob

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.

10. Nov 14, 2004

### Tide

I'm sorry - I don't use MatLab so I can't help you with the specifics of that package.