Go to Post Don't date anyone on your team unless you are POSITVE that you will be able to handle yourself professionally, not only during your relationship, but even after it ends. - Jaine Perotti [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 14-12-2012, 20:34
Richard Wallace's Avatar
Richard Wallace Richard Wallace is offline
I live for the details.
FRC #3620 (Average Joes)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1996
Location: Southwestern Michigan
Posts: 3,675
Richard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond repute
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.
__________________
Richard Wallace

Mentor since 2011 for FRC 3620 Average Joes (St. Joseph, Michigan)
Mentor 2002-10 for FRC 931 Perpetual Chaos (St. Louis, Missouri)
since 2003

I believe in intuition and inspiration. Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution. It is, strictly speaking, a real factor in scientific research.
(Cosmic Religion : With Other Opinions and Aphorisms (1931) by Albert Einstein, p. 97)

Last edited by Richard Wallace : 14-12-2012 at 20:49.
  #17   Spotlight this post!  
Unread 14-12-2012, 21:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest


Excellent post Richard.

You anticipated where I was going to take this.


Attached Thumbnails
Click image for larger version

Name:	IMG_5053-1a.jpg
Views:	92
Size:	156.7 KB
ID:	13293  Click image for larger version

Name:	IMG_5054-1.jpg
Views:	59
Size:	116.3 KB
ID:	13294  Click image for larger version

Name:	IMG_5055-1.jpg
Views:	44
Size:	187.3 KB
ID:	13295  

Last edited by Ether : 14-12-2012 at 23:21.
  #18   Spotlight this post!  
Unread 14-12-2012, 23:23
DampRobot's Avatar
DampRobot DampRobot is offline
Physics Major
AKA: Roger Romani
FRC #0100 (The Wildhats) and FRC#971 (Spartan Robotics)
Team Role: College Student
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Stanford University
Posts: 1,277
DampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond reputeDampRobot has a reputation beyond repute
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.
__________________
The mind is not a vessel to be filled, but a fire to be lighted.

-Plutarch
  #19   Spotlight this post!  
Unread 14-12-2012, 23:28
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,554
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by DampRobot View Post
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.
Even getting a reasonable approimation is good enough, because there is no exact answer. I simplified until I ended up with a formula that looked something like this:

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.
  #20   Spotlight this post!  
Unread 15-12-2012, 01:15
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by DampRobot View Post
Was the "challenge" to write a program that found the solutions of these functions through guess and check?
There is no explicit solution so you have to use iteration.

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


Attached Thumbnails
Click image for larger version

Name:	equations.png
Views:	28
Size:	13.8 KB
ID:	13298  Click image for larger version

Name:	Taylor.png
Views:	16
Size:	4.2 KB
ID:	13302  
Attached Files
File Type: pdf code.pdf (25.7 KB, 10 views)

Last edited by Ether : 15-12-2012 at 01:51.
  #21   Spotlight this post!  
Unread 15-12-2012, 12:50
IKE's Avatar
IKE IKE is offline
Not so Custom User Title
AKA: Isaac Rife
no team (N/A)
Team Role: Mechanical
 
Join Date: Jan 2008
Rookie Year: 2003
Location: Michigan
Posts: 2,153
IKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond reputeIKE has a reputation beyond repute
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.
  #22   Spotlight this post!  
Unread 15-12-2012, 13:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by DampRobot View Post
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.
I think you made a mistake somewhere along the way. Those equations don't look correct.

x/2 = rsin(l/2r), not (r-h)sin(l/2r)

and

2rsin(l/r) = x, not (x^2/4+h^2)^1/2


  #23   Spotlight this post!  
Unread 15-12-2012, 17:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by k4mc View Post
I believe the answer is 44.4984550191007992545541 feet

(although I used a "wolfram alpha method" , not an analytic one to solve the equation)
Sorry, I completely overlooked your post !

You were the first to get a correct answer.

Would you please post you work?


  #24   Spotlight this post!  
Unread 15-12-2012, 18:20
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by Ether View Post
Sorry, I completely overlooked your post !

You were the first to get a correct answer.
I don't think you overlooked it. There seems to be a delay in people getting their first couple of posts published when they are new to the forum. The awkward thing is those posts then sneak back into the list of posts in the spot they were written at. Easy to miss them completely if a lot of posts have been written in the mean time.
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)
  #25   Spotlight this post!  
Unread 15-12-2012, 18:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by Alpha Beta View Post
...those posts then sneak back into the list of posts in the spot they were written at.
Aha. So I'm not losing my mind (yet).


  #26   Spotlight this post!  
Unread 15-12-2012, 21:41
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by Tom Line View Post
sin (theta/2) = (theta * Arc) / (2 * chord length)
That should be sin (theta/2) = (theta * chord) / (2 * arc)


  #27   Spotlight this post!  
Unread 16-12-2012, 18:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest


Just for fun, here's a graph showing the behavior of the 2nd, 4th, 6th, and 8th degree Taylor approximations for the sinc function from zero to 3pi/2 radians.

Here's Maxima code to generate the graph.

Maxima is free software with an active and helpful mailing list.


Attached Thumbnails
Click image for larger version

Name:	Taylor2468code.png
Views:	12
Size:	8.6 KB
ID:	13313  Click image for larger version

Name:	Taylor2468graph.png
Views:	28
Size:	13.1 KB
ID:	13314  

Last edited by Ether : 16-12-2012 at 18:31.
  #28   Spotlight this post!  
Unread 16-12-2012, 18:38
Richard Wallace's Avatar
Richard Wallace Richard Wallace is offline
I live for the details.
FRC #3620 (Average Joes)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1996
Location: Southwestern Michigan
Posts: 3,675
Richard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by Ether View Post

Just for fun, here's a graph ...
It would be interesting to see a graph comparing the 2nd, 4th, 6th, and 8th order expansions of 1 - sinc(x) plotted vs. x, for 0 < x < 0.05. The range of most interest will be near 1/5280 ....

I'd do it myself, but have been unable to locate Maxima as an iPad app (yet).
__________________
Richard Wallace

Mentor since 2011 for FRC 3620 Average Joes (St. Joseph, Michigan)
Mentor 2002-10 for FRC 931 Perpetual Chaos (St. Louis, Missouri)
since 2003

I believe in intuition and inspiration. Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution. It is, strictly speaking, a real factor in scientific research.
(Cosmic Religion : With Other Opinions and Aphorisms (1931) by Albert Einstein, p. 97)
  #29   Spotlight this post!  
Unread 16-12-2012, 20:19
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by Richard Wallace View Post
It would be interesting to see a graph comparing the 2nd, 4th, 6th, and 8th order expansions of 1 - sinc(x) plotted vs. x, for 0 < x < 0.05. The range of most interest will be near 1/5280 ....
... or 1/5281

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.


Attached Thumbnails
Click image for larger version

Name:	1-sinc.png
Views:	9
Size:	16.6 KB
ID:	13315  Click image for larger version

Name:	Taylor2468err.png
Views:	9
Size:	19.3 KB
ID:	13316  Click image for larger version

Name:	Taylor8NumericalStability2.png
Views:	1
Size:	19.0 KB
ID:	13318  

Last edited by Ether : 16-12-2012 at 21:00.
  #30   Spotlight this post!  
Unread 16-12-2012, 21:11
Bill_B Bill_B is offline
You cannot not make a difference
FRC #2170
 
Join Date: Jan 2010
Rookie Year: 2004
Location: Connecticut
Posts: 1,099
Bill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond repute
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?
__________________
Nature's Fury FLL team 830 - F L eLements
FRC team 2170 - Titanium Tomahawks
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi