Python Physics: Modeling the Wolf and Hare Problem
Vložit
- čas přidán 8. 09. 2024
- A wolf has a speed of 4 m/s and is chasing a hare moving at 3 m/s. If the wolf always aims towards the hare, what path will the wolf take? One way to answer this question is to model the motion in python - so that's what I did.
Here is the python code
trinket.io/glo...
Predator/Prey problem, and really interesting 🐺 🐇
Let d = initial distance between them, W = speed of Wolf, H = speed of Hare. The time it takes the wolf to capture the hare is given by average of i) time when they move towards the other [d/(W+H)], and ii) time when they move away from the other [d/(W-H)]. For d= 15m, W= 4.5 m/s, H=3m/s, we get t = 0.5(15/7.5 + 15/1.5) = 0.5(12), so t = 6 seconds. Note: equation for time of capture is only valid if the initial velocities are perpendicular.
I can do it, I’ll send my webpython code.