![]() |
Re: numerical computation contest
Russ,
I understand you intended this one as a programming exercise -- hence you posted it in the programming forum. However, it can also serve as an example of engineering approximation. Jon showed earlier how the Pythagorean theorem gives 51.48 ft as a rough approximation. For a slightly better one, I used the Taylor series expansion for the sinc function, defined as sinc(x) = sin(x)/x. The first two terms of that expansion are: sinc(x) = 1 - (x^2)/6 + .... The arc length is 2rx and the chord length is 2rsin(x), where 2x is the angle subtended by the arc. Since the chord is one mile long and the arc is one foot longer, we have: sinc(x) = 5280/5281 and the truncated series approximation above gives x = sqrt(6/5281) = 0.03371 radians, or about 1.931 degrees. Then the arc is part of a circle with perimeter (5281/5280) x (180/1.931) = 93.23 miles, so the radius r is 14.84 miles [this is a very flat arc!] and the height h is 14.84 x (1 - cos(x)) miles = 44.49 ft. Back in the day, engineers without benefit of cheap computers could have gotten this close using slide rules; i.e., four figures. |
Re: numerical computation contest
3 Attachment(s)
Excellent post Richard. You anticipated where I was going to take this. |
Re: numerical computation contest
Ether,
I'm not a programmer, but I love a good geometrical challenge. The equations I came up with were: (r-h)sin(l/2r)=x/2 and 2rsin(l/2r)=(x^2/4+h^2)^1/2 where r was the radius of the curve, h was the height specified in your diagram, l was the length of the curve, and x was the length of the chord. To find the numerical solution, input values for l and x, and solve for h or r. Was the "challenge" to write a program that found the solutions of these functions through guess and check? Or did I come up with a different solution? Plugging in the values on this thread with my trusty graphing calculator, I got a reasonable approximation of the answers posted on this thread. |
Re: numerical computation contest
Quote:
sin (theta/2) = (theta * Arc) / (2 * chord length) With theta being the angle inside the two radii that would have gone from the center of the circle to the end of the cords. That can only be solved iteratively, graphically, or by a lookup table (for those of us who remember not having calculators....) Once you have theta, the height is trivial. |
Re: numerical computation contest
3 Attachment(s)
Quote:
For folks like Christopher149 who know how to use modern math tools like Mathematica this is very simple to do, and you can get answers of arbitrary precision. Mathematica is very expensive, but there are free CAS (Computer Algebra System) tools like Maxima which anybody can download and install for free. Maxima can also solve this problem with arbitrary precision (see my earlier post where I used Maxima to get 600 digits). Attached are: - The derivation of the equations - A simple Delphi console app code which uses a binary search to find theta If you replace sin(theta)/theta - 5280/5281 with a 12th degree Taylor expansion (see Richard's earlier post about Taylor expansion), you can squeeze out 16 decimal digits of accuracy with this simple code using Intel's X86 Extended Precision floats |
Re: numerical computation contest
This reminds me of a chapter in one of my favorite books:
The History of PI Specifically, you guys are reminding me of chapter 10, "The Digit Hunters". I am very impressed. Happy hunting. |
Re: numerical computation contest
Quote:
x/2 = rsin(l/2r), not (r-h)sin(l/2r) and 2rsin(l/r) = x, not (x^2/4+h^2)^1/2 |
Re: numerical computation contest
Quote:
You were the first to get a correct answer. Would you please post you work? |
Re: numerical computation contest
Quote:
|
Re: numerical computation contest
Quote:
|
Re: numerical computation contest
Quote:
|
Re: numerical computation contest
2 Attachment(s)
|
Re: numerical computation contest
Quote:
I'd do it myself, but have been unable to locate Maxima as an iPad app (yet). |
Re: numerical computation contest
3 Attachment(s)
Quote:
sin(θ)/θ = 5280/5281 = 1 - 1/5281 => 1 - sin(θ)/θ = 1/5281 The Taylor expansions (even the 2nd degree one) are so accurate over the range 0<x<0.05 that you can't see the difference on the graph at that scale. Which maybe was your point :) Also attached is the 64 decimal digit precision computation of θ using the zero of the function y = 5280/5281 - sin(θ)/θ and its Taylor expansions. Finally, notice that the Taylor8 expansion actually gives a more accurate answer than the original function itself, when using only 16 digit precision. Presumably, this is because Taylor8 is numerically more stable. |
Re: numerical computation contest
This whole thread reminds me of an easy (for you all) geometry question. Imagine a sphere the diameter of the Earth. Add to that a belt around the equator that has no space between it and the surface of the sphere. By how much must the length of that belt be increased to allow a playing card to be slipped underneath the belt at all points along it?
|
| All times are GMT -5. The time now is 21:39. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi