d = constant, it's simply the initial separation. How can d "move left"?
Printable View
d = constant, it's simply the initial separation. How can d "move left"?
It's a perspective thing. If you view your graph as being the same size, both points moves left.
If you view d as being a constant and staying the same distance apart, then the graph becomes larger (keeping the same shape, but over a larger area of hte graph), and the asymptote moves to the right.
In other words, if you get a graph with equal speeds, and a graph with the wolf at twice the speed... you should be able to scale them so they overlap, and the curve portion should look identical.
Scratch all the above, I made a simple mistake!
The differential equations are wrong.
They should be:
http://i39.tinypic.com/15f6ku8.jpg
With the same method as described in the derivation earlier, I now get the solution:
http://i42.tinypic.com/2qsmgrm.jpg
The graph has a vertical asymptote at x = d, for any speeds v and w.
BOOYAH! I'm confident this is correct :p
New derivation:
pw is the position vector of the wolf.
pc is the position of the chicken.
Their difference is the vector pointing from wolf to chicken, and this is the direction the wolf runs:
http://i43.tinypic.com/2iifss0.jpg
Nick, can you elaborate on dx/dt an dy/dt represents? And how did you get x(t) and y(t)? It looks like you just integrated by separating the variables. Is that right?
Also, how far does the chicken get before getting caught according to your solution?
dx/dt is the derivative of x with respect to t. Same for dy/dt, but with y. It is basically the rate of change of x and y respectively. Together, they form a differential equation. I solved it indeed by basically integrating (although it's a little more complicated than that). The equation for x is separable (with d as the particular solution, if you know what that means), but the second is not due to the wt part, so a slightly different method is required to solve that. I must admit I did it with a computer program, but it's easily done by hand too.
I'll try to determine when the wolf catches the chicken. Hold on.
EDIT
Hmmff... Now I'm doubtfull again haha. I can't do it, there's no solution.
The solution should be x(t) = d, and y(t) = w*t.
x(t) = d - d exp(-t/v) = d
--> 1 - exp(-t/v) = 1
exp(-t/v) = 0
An exponential decay as exp(-t/v) never reaches zero, only in the limit that t --> infinity.
y(t) = -wv + wt + exp(-t/v) w v = wt
0 = exp(-t/v) - 1
exp(-t/v) = 1
Solution: t = 0.
Of course, t = 0 is valid, since then y(t) = 0, and the chicken is also at y = 0. But we need the other solution, which does not exist... Damn!
Well, it turns out I was wrong after all. The solution is actually pretty well known, and it's called the Pursuit Curve.
If you look at the parametric equation (4), you can see I was pretty close lol. But not quite.
The solution is equation (15) on that website, with general coefficients c1 and c2. We can use equatoin (18), with y0 = x0 = 0 to determine what we need.
I'm tired however, and now we have a solution for the curve of the path, we have solved the problem. Figuring out the time, distance etc is straightforward. I might try it tomorrow if I feel like it :p
well I got snack time at ~61.6 seconds with a run of ~313.1m from my sim, I'll be interested to see how close it is.
Okay your DE's look okay... Do you have an answer
My DE's, or the DE's on the Pursuit Problem site?
My DE's are wrong. I am now trying to work out the solution using the method given on the pursuit problem website. The problem is that they do it for v = w = 1. I want it for arbitrary v and w, which is why I need to copy what they did, except now for v and w :p
In each case, this is NOT an easy solution.
Whoa.... Okay this is a big development... I've never seen that before. I wonder if some insight can be gained from that to get the 'simple' solution.Quote:
Well, it turns out I was wrong after all. The solution is actually pretty well known, and it's called the Pursuit Curve.
If you look at the parametric equation (4), you can see I was pretty close lol. But not quite.
The solution is equation (15) on that website, with general coefficients c1 and c2. We can use equatoin (18), with y0 = x0 = 0 to determine what we need.
I'm tired however, and now we have a solution for the curve of the path, we have solved the problem. Figuring out the time, distance etc is straightforward. I might try it tomorrow if I feel like it
P.S. I think your DE's were correct. I dunno about the solution but your starting point looked okay
Are you sure your DE's are wrong? They look correct to me. I'll take a look at the Puruit problem link you posted. Looks good so far. There may be something there we can exploit to get the simple solution. I'll post my solution and the simple solution soon. I just want to give others some more time for alternative methods.
Nah, they were close though. The correct DE's are on the site, equation (4). It makes sense after reading that site. I'm working it out now, nearly there, but I think they made a mistake (minus sign instead of + sign somewhere) :p
I think I finally got the answer. It was a rough ride though, not simple at all. Surprisingly, the final answer is pretty simple!!
I am now assuming that the speed of the chicken is w, the speed of the wolf is v, and the separation is d. The wolf starts at [d,0] however (to the right of the chicken), not at [-d,0] as in my previous calculations. It shouldn't matter in the final answer, but it does to understand the graph.
The answer I got is:
http://i41.tinypic.com/10zajwk.jpg
And you may be happy to see that the time is exactly what jemidiah got! At least if I read his use of symbols correctly :p
The complete derivation (warning, it's complicated and leaves out most of the hard labour such as actually calculating the integrals, I used my computer for that mostly) is attached.
A graph for v = 1, w = 0.5 and d = 10:
http://i39.tinypic.com/24azghl.jpg
Now... I'm done with this xD
I'm not going to look at the pursuit problem page, just so I keep my own train of thought rolling :). The big issue is that the variables in the system are intermeshed, and it's a non-linear system to boot. I was hoping you wouldn't spend too long on that DE when I first saw it and I'm glad you found the mistake. The key to thinking about what shape the curve is, I think, is to examine the slope of the wolf's function. It shows a non-parabolic path pretty quickly.
I derived f by making a simulation and trying a few different functions. I know heuristically that (a) f wouldn't have higher than second-order terms, (b) it might have a few special functions but since wy125 said the answer was simple those would be limited to logarithm and exponent. From there it wasn't tough to trial-and-error it out.
I've thought about it more since then. Using my various time and distance scaling ideas, the problem can be reduced to one with a single parameter--set d=1, wolf speed = 1, and vary sheep speed. Try graphing a few trajectories and you'll see... some type of deformation is happening. That is, the coordinates are being transformed by some almost certainly non-linear transformation which preserves curvature (i.e. the wolf's speed), x-axis initial distance, and scales y-axis speed.
If someone from on high could give me the coordinate transformation, the solution would follow in a few lines of algebra. Maybe there's another way to get at it. I can see how you've spent so much time on this problem. It's somehow very engrossing.
Congratulation to Jemidiah and Nick who both got the correct answer. I've attached my solution, which was basically setting up the differential equation and burning through it. This pursuit stuff looks interesting. There may be something there to give us the coveted 'simple' solution.
Let me know when you guys want me to post the simple solution. To reiterate, the simple solution is identical to the one we all got but it's derived in a very simple manner. Jemidiah may be onto something with his coord transforms leading to a few lines of algebra....
You seem to have the same final equation as me, except you wrote is it x = f(y) instead of y = f(x).
And I would like to hear the simple solution. If you don't want to post it here to spoil others can you PM me? I'm known for solving problems the hard way when there's a very simple solution :p
PS, does the simple solution also give you the curve of the path, or just the time it takes the wolf to catch the chicken?
Nick. Yes our equations are the same. My coords were just set up differently.
The simple solution does not give you the path; it only gives the distance/time it takes to get the chicken. The problem I have is seeing how they were able to justify it. There wasn't really an explanation. I will pm you the answer....
313 is the length of the wolfs run. I got Y intercept at something around ~187. I'd actually scaled the numbers quite a bit 0.0003 and 0.0005 (more like slug and worm) so I might well have made an error scaling back the time.
I'm no maths jock I'm hanging here for the learning. ;)
But what speeds for the wolf and the chicken, and which initial separation? If you got v, w and d, you can enter them into the equation I posted above and it will tell you the time and distance the chicken travels. You can then compare those to what your sim tells you.
In the mean time, I got the pm with the easy solution, and it's not very obvious to me either. I won't post it now, but I did ask in the other forum, and a hint I got was to try and calculate the time required from the wolf's perspective, eg in the wolf's coordinate system. I still don't understand why that should make it obvious :p
187 is almost right on the money. So your sim is pretty accurate
I have a small idea... I think (not 100% sure) that the rate of change of the distance between the wolf and chicken is CONSTANT. Which means that the distance between them decreases linearly. The other guy on the forum told me I was pretty close... But I still can't figure it out hahaha...
It's obviously true when they move directly away from or toward each other, but in this 'curved' scenario, I can't see it so quickly :p I think it's true though.
I'm pretty sure the other guy knows, he just wants me to figure it out on my own.
Let's see... If the distance between wolf and chicken decreases linearly, then if you stay in the wolf's point of view, isn't it simply a case where the chicken slowly moves in a straight line towards the wolf? That is, if we also rotate with the wolf.
I might try simulating that in my sim...
EDIT
If I only take into account the movement of the wolf, I indeed get half a raindrop shaped path for the chicken. But, we also need to rotate the view so that the wolf keeps facing the same direction! One sec ;)
hmmm... let me think about this... what do you mean exactly by the curved distance? Do you mean the path that the wolf ends up taking? If so, let's call it s. The rate of change with respect to time is ds/dt, which is the wolf's speed. So yeah that's definitely constant.
Do you mean the linear distance? Yeah run that in the sim and see what you get... That would be interesting....
I mean the distance between the two.
Well, I must admit I have no idea how to make my simulation rotate itself :p
I have been able to move the viewer with the wolf, by simply substracting the distance the wolf moved from both the wolf and the chicken. So, the wolf remains stationary, and the chicken moves towards the wolf in a raindrop shape.
To rotate it however... I'm kinda lost :p
Right now I've got this in XNA (C#):
Code://1. Move chicken
C.Position.X += C.Direction.X * C.Speed;
C.Position.Y += C.Direction.Y * C.Speed;
//2. Update wolf direction
W.Direction.X = C.Position.X - W.Position.X;
W.Direction.Y = (C.Position.Y - W.Position.Y);
// normalize
float norm = (float)Math.Sqrt((Math.Pow(W.Direction.X, 2) + Math.Pow(W.Direction.Y, 2)));
W.Direction.X = W.Direction.X / norm;
W.Direction.Y = W.Direction.Y / norm;
W.Rotation = (float)Math.Atan(W.Direction.Y / W.Direction.X);
//3. Move wolf
float dX = W.Speed * (float)Math.Cos(W.Rotation);
float dY = W.Speed * (float)Math.Sin(W.Rotation);
W.Position.X += dX;
W.Position.Y += dY;
//// Let's keep the wolf on the same position
W.Position.X -= dX; W.Position.Y -= dY;
C.Position.X -= dX; C.Position.Y -= dY ;
I am pretty much certain that, in the wolf's frame of reference, the chicken merely moves towards the wolf in a straight line. Think about it. Imagine you are the wolf! Why would it not be a straight line? If it's not a straight line, that means you must be 'looking ahead' in order to intercept the chicken, which is exactly what the wolf does NOT do.
Just compute the distance...
Use the x,y coords of the wolf and chicken and compute the distance each iteration to see how it changes.
Yeah, the other dude just confirmed... From the wolf's perspective, it's simply a straight line. The chicken moves towards him at constant speed in a straight line.
So what can we deduce from that?
I don't think the chicken moves towards the wolf at a constant speed. The wolf initially closes in on the chicken at a rate of v_wolf, but by the end he's closing in at a rate of v_wolf-v_chicken. It's still an interesting idea; I'll file it as another avenue to try.
Assuming a chicken speed of 3m/s and a wolf speed of 5m/s. When they first start out, the chicken is going perpendicular to the wolf. So the wolf is gaining on the chicken at a rate of 5m/s.
As they end up closer and closer to heading in the same direction, the rate of closure drops down to 2 m/s, because the wolf is gaining at 5 m/s and the chicken is moving at 3 m/s.
Because of this, it's not possible that the wolf is gaining on the chicken at a constant speed. If so, your answer would be (distance separating)/(difference in speeds). So with the initial numbers of 200m / 2m/s that'd be 100 seconds they would travel. (or 300m chicken and 500m wolf)
Yeah both fizziii and jemidiah are right.
Your logic makes sense, but I'm not convinced yet. I'm talking about the wolf's frame or reference, in which the wolfs speed is ZERO!
Okay, we'll deal with the wolf's frame of reference. At the beginning, the side of the chicken is coming towards the wolf at 5m/s.
As time progresses, the chicken rotates away from the wolf, and the chicken's speed towards the wolf reduces towards 2 m/s.
Edit: You could also look at it with the chicken & wolf having identical speeds. At time zero, the wolf is moving towards the chicken at his speed and the chicken is not moving away.
Then for all practical purposes, the wolf ends up chasing the chicken with both of them traveling the same speed resulting in the chicken moving towards the wolf (from the wolf's perspective) at a speed of 0m/s.... so the speed of the chicken from the wolf's perspective can not be constant.
Looking at it from the wolf's frame of reference is very similar to considering the distance separating the two. That distance does not decrease constantly.
I've been thinking about it more and have shown one nice thing, at least. Consider the average speed of the wolf in only the horizontal direction. For him to capture the chicken, he must move a distance d in time tc. Extending my ideas from my first post, you can show
d = tc*v_wolf*g(s) where s = v_chicken/v_wolf.
The average speed of the wolf in the horizontal direction is then v_wolf*g(s). Working backwards from the answer, it turns out g(s) = 1-s^2; that is, the average speed of the wolf has a correction factor of (1-s^2). The partial derivative of this factor with respect to s is proportional to s--this (along with a few border conditions) is enough to give the answer.
If we can find some reason to say that the correction factor scales in this manner [that is, dg/dp is proportional to s) as the ratio of the chicken to the wolf's speed increases, the answer follows immediately.
I've thought more about my other approach with symmetries. It could certainly work, but it would appear magical and I would need knowledge of the solution curves to find a symmetry, so I've put that on hold.
Okay so for those of you who have been following this thread I think it's time to post the so-called 'simple' solution. Here it goes. I'm putting it in white so you don't have to read it if you don't want to:
Simple Solution:
In order to figure out how far the chicken gets you simply take the average of two distances -- how far the chicken gets if the wolf and chicken run directly at each other and the distance when running directly away from each other. I'll leave the math to you guys since it's very easy.