| New Reply |
Computer Program for Dog Chasing Rabbit |
Share Thread | Thread Tools |
| Apr7-12, 07:52 PM | #1 |
|
|
Computer Program for Dog Chasing Rabbit
Hey all, I am trying to work on my programming skills. I write programs in C, and I am attempting to write a computer algorithm such that for some small t. Let's call it dt we get the position of a dog, and the position of a rabbit, as the dog chases the rabbit. This is being asked on a mathematics portion because its a differential equation. The prototypical Dog chases a rabbit with some velocity greater than the rabbits, and we want to know what path the Dog takes. I have a program written such that all I need is to plug in points and it will graph the path... The only problem I am running into is how to create an algorithm for this... Any and ALL help is appreciated!
I know the analysis equation, and how that would make this much easier, however, being an applied Mathematics type person I want to write a computer script without using that. |
| Apr7-12, 08:10 PM | #2 |
|
|
It would help if you spell out your specific problem with more detail: it sounds like you have a differential equation that you just want to calculate the solution of numerically but I really can't be sure |
| Apr7-12, 08:24 PM | #3 |
|
|
Consider a rabbit which sits a distance L east of a dog. At time t = 0 the rabbit
starts running north (in y-direction) at constant speed v. The dog starts chasing the rabbit at constant speed 2v, and always changes its running direction towards the rabbit. The rabbit always runs north and never changes direction. Basically I want a program that goes toward the rabbit other than the easy y=2/3*L{1-(x/2L+1)*sqrt(1-x/L)} and I understand it will never become zero... But I want to simulate this... |
| Apr8-12, 12:03 AM | #4 |
|
|
Computer Program for Dog Chasing Rabbit
If you have the current position of the rabbit and of the dog, there are two steps
1 calculate the velocity of the dog 2 assume some small time 1/100 if a second say, had passed and add 1/100th of the signs velocity to his position, and similarly for the rabbit |
| New Reply |
| Thread Tools | |
Similar Threads for: Computer Program for Dog Chasing Rabbit
|
||||
| Thread | Forum | Replies | ||
| DE problem: Dog chasing a rabbit | Differential Equations | 20 | ||
| Differential Equation - Path of Dog Chasing a Rabbit running in a curved path | Calculus & Beyond Homework | 2 | ||
| Computer Program | Programming & Comp Sci | 0 | ||
| Computer program | General Discussion | 23 | ||
| Computer Program | Set Theory, Logic, Probability, Statistics | 5 | ||