
14-12-2012, 17:16
|
 |
systems engineer (retired)
no team
|
|
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
|
|
|
Re: numerical computation contest
Quote:
Originally Posted by Christopher149
Mathematica Code
Code:
Clear[t, h, r, c, a]
c = 5280
a = 5281
t = t /.
FindRoot[a/(2 t) * Sin[t] == c/2, {t, 1.8},
AccuracyGoal -> 100000, PrecisionGoal -> 100000,
WorkingPrecision -> 500]
r = a/(2 t)
FindRoot[r == c^2/(8 h) + h/2, {h, 100}, AccuracyGoal -> 100000,
PrecisionGoal -> 100000, WorkingPrecision -> 500]
|
Here's Maxima code:
Code:
fpprec: 600$
L:5280$ eps:1$
y: x/sin(x)-(L+eps)/L$
a: bf_find_root(y,x,1/1000,4/100);
h: (L/2)*(1-cos(a))/sin(a);
Quote:
EDIT: I can get more decimal places ...
|
So can I
Code:
Maxima 5.27.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
(%i1) fpprec: 600$
L:5280$ eps:1$
y: x/sin(x)-(L+eps)/L$
a: bf_find_root(y,x,1/1000,4/100);
h: (L/2)*(1-cos(a))/sin(a);
4.4498455019100799254554160016733598949968964352229561211688059554658168\
699956051975334723610652925014422691969000110577445163659978002373921158891281\
961079122339560352790946889732641412850383528339799280892308107161666785352632\
556370781259728977129034979416624799668990733212350734392869697893501318891119\
435591779774054312719121214164103632340254095275303249287104781014962478813559\
412501235222884006058879524106347465534347539833791041297948729285690841569378\
338955156536796873312602070842136063260258182278201500825791387457906343098887\
9258590281352783951539842610751922916884732140489864979154825b1
(%i7)
|