"quasi" <email@example.com> wrote in message news:firstname.lastname@example.org... > A computational challenge (but not too hard) ... > > A tornado in the shape of an open disk of radius 2 miles, moves at > constant speed on a straight course. A man, directly in the path of > the center of the tornado, notices the tornado when the closest point > of the boundary of the tornado is 1/4 mile away. If the man can run at > a speed 20% faster than the speed of tornado, what is the length in > miles, rounded to 3 decimal places, of the shortest escape path by > which the man can reach the edge of the rectangular strip of the path > of the tornado without being enveloped by it? > > Use of a CAS is encouraged. > > quasi
OK, I'll have a go...
I've already said in other posts how I think the solution path should go, so here is just a summary - I'm sure it won't make sense for someone just reading this post in isolation, but perhaps it will help quasi see more easily where I've gone wrong, assuming we get different answers.
So I consider the path in the frame of the moving tornado. There are three components: 1) A tangent from the man's start position to the tornado 2) A curved path (arc) around the tornado 3) A final "dash for the edge" where the man runs perpendicular to the tornado path to the escape line. (This is not perpendicular in the tornado frame, of course, as the tornado is catching up with the man during this phase.)
First some constants I used:
R = 2.0; // radius of tornado S = 2.25; // starting point for man (from centre of tornado) k = 5.0/6.0; // ratio tornado speed to man speed
A1 = Angle where tangent for 1st path component meets tornado (measured from direction of tornado travel)
A2 = Angle where tangent for 3rd path component leaves tornado (measured from direction of tornado travel)
Now we have the problem that we know the path we want in the tornado frame T, but we actually want distances in the fixed (problem statement) frame F. Given a line element in the T-frame, there is a multiplication factor that we should multiply it by, to get the F-Frame, which I call M(A). I.e. the factor is a function of the angle A that the line segment is making with a perpendicular line IN THE T-FRAME, measured in the direction towards the tornado. For a given angle A, we can use the cosine rule for triangles to work out M(A):
OK probably we could simplify a bit, but I didn't bother as it was coded in a program any way so it didn't matter what it looked like! By trial for known angles it turns out we want the plus sign in the +- in the formula, so that is my function M(A).
Now we can calculate the components of the path length in the F-Frame, which is what we want for the final answer:
Path segment 1:
T1 = Length of tangent in Tornado frame = R * tan (A1); F1 = Length of path segment in fixed frame = M(A1) * T1 = 0.978375 <====
Path segment 2:
The angle is varying along the path here, so we need an integral: F2 = Length of path segment in fixed frame = Integral from A1 to A2 of [R * M(A)] dA = 0.372628 <====
Path segment 3:
Since we know A2, it's easiest to just work out the distance from the outset in the F-Frame, ignoring the tornado frame altogether: F3 = Length of path segment in fixed frame = R * (1 - sin(A2)) = 0.719631 <====
So the total distance in the original problem frame (F-frame above) is F1 + F2 + F3 = 2.070634
Er, that's it!
Hmmm, looking at it now, it looks sort of plausible, but also rather low, given that the minimum perpendicular distance is 2.00000. Still, maybe the man doesn't really have to deviate that far from perpendicular to avoid the tornado - I'll wait to see what quasi makes of it...
Also, I didn't have any CAS to help with the integral in path segment 2, so I had to write a quick subroutine to estimate the integral, but I'm not 100% confident I've not accumulated rounding errors, even assuming I've coded it correctly at all! (It seemed to be working ok on some simple test functions...)