Post Reply 
Lockup Calculating Arc Length of Ellipse
10-16-2014, 07:24 PM
Post: #1
Lockup Calculating Arc Length of Ellipse
I am calculating the following integral:


sqrt(4*(sin(t))^2 + (cos(t))^2) 0 < t 2*pi


My TI-89 calculates 9.68845 in about 25 seconds, but my Prime locks up and requires a hard reset.
Find all posts by this user
Quote this message in a reply
10-16-2014, 07:41 PM (This post was last modified: 10-16-2014 07:46 PM by Tim Wessman.)
Post: #2
RE: Lockup Calculating Arc Length of Ellipse
Works fine here (hw/emu), so I suspect that has been resolved with later CAS versions. Returns 9.68844822

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
10-16-2014, 07:59 PM (This post was last modified: 10-16-2014 08:00 PM by Mark Hardman.)
Post: #3
RE: Lockup Calculating Arc Length of Ellipse
(10-16-2014 07:41 PM)Tim Wessman Wrote:  Works fine here (hw/emu), so I suspect that has been resolved with later CAS versions. Returns 9.68844822

I can reproduce the issue. If an approximate result is requested, then the definite integral immediately returns the result. However, if an exact answer is requested, then the current version (6031) of the emulator hangs.

[Image: attachment.php?aid=1136]


Attached File(s) Thumbnail(s)
   

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
10-16-2014, 08:08 PM
Post: #4
RE: Lockup Calculating Arc Length of Ellipse
Checked with the latest version of Xcas:
int(sqrt(4*(sin(t))^2 + (cos(t))^2),t,0,2*pi)
returns integrate(sqrt(5/2-3/2*cos(2*t)),t,0,2*pi)
while
int(sqrt(4*(sin(t))^2 + (cos(t))^2),t,0.,2*pi)
returns 9.68844822055
I'll check tomorrow on the calc. The firmware is a bot old now compared to the latest version of Xcas, many bugs have been fixed in Xcas...
Find all posts by this user
Quote this message in a reply
10-17-2014, 04:16 AM
Post: #5
RE: Lockup Calculating Arc Length of Ellipse
On the physical Prime, if one simplifies the integrand first with simplify(),

then int(sqrt(3*sin(x)^2+1),x,0,pi*2) does at least not hang the calculator (if that is any consolation) - - but it doesn't give an exact solution, either, rather an unnecessarily complicated integral of sqrt(-3/4*cos(2*x)+i*sin(2*x))+ ... with an info message "searching int of sqrt(...) where x is on the unit circle, using residues . . . sign error vector [<1,1>]". ?
Find all posts by this user
Quote this message in a reply
10-17-2014, 05:07 AM
Post: #6
RE: Lockup Calculating Arc Length of Ellipse
Unchecking EXACT fixes the problem and gives an instant result.

(had a similar problem with hangs when doing an inverse Laplace transform, except there, unchecking EXACT caused the problem)
Find all posts by this user
Quote this message in a reply
10-17-2014, 03:00 PM (This post was last modified: 10-17-2014 03:32 PM by Helge Gabert.)
Post: #7
RE: Lockup Calculating Arc Length of Ellipse
Well, yes, but the idea (for me) is to obtain an exact solution, if possible . . . if you wanted the approximate solution in the first place, fine, but why not just calculate that in Home?
Find all posts by this user
Quote this message in a reply
10-20-2014, 08:10 AM
Post: #8
RE: Lockup Calculating Arc Length of Ellipse
(10-17-2014 03:00 PM)Helge Gabert Wrote:  Well, yes, but the idea (for me) is to obtain an exact solution, if possible . . . if you wanted the approximate solution in the first place, fine, but why not just calculate that in Home?

I think this is one of those integrals that does not have a closed form solution.

Wolfram Alpha gives the exact answer as 4*E(-3) where E(x) is the "Complete Elliptic Integral of the Second Kind" which can be defined in terms an integral.

-wes
Find all posts by this user
Quote this message in a reply
10-20-2014, 02:20 PM (This post was last modified: 10-20-2014 03:53 PM by Helge Gabert.)
Post: #9
RE: Lockup Calculating Arc Length of Ellipse
Yes, I know that. The prime could give that answer (4E-3), provided it knows about elliptic integrals, or an approximate value (after issuing an informational message), but certainly not lock up. However, my main point is, why work in CAS, when all you are after is an approximate solution? Do it in Home (or if you really like to work in CAS, put something like 2.0*pi into the limits in order to force an approximate solution). No CAS flags to change.
Find all posts by this user
Quote this message in a reply
10-20-2014, 06:04 PM
Post: #10
RE: Lockup Calculating Arc Length of Ellipse
I don't plan to implement elliptic integrals now. Perhaps in the future, using the arithmetic-geometric mean.
Find all posts by this user
Quote this message in a reply
10-20-2014, 09:44 PM
Post: #11
RE: Lockup Calculating Arc Length of Ellipse
Sounds good; thanks for the info!
Find all posts by this user
Quote this message in a reply
10-21-2014, 05:07 PM
Post: #12
RE: Lockup Calculating Arc Length of Ellipse
Hallo all,

Quote:original from parisse:
Perhaps in the future, using the arithmetic-geometric mean.

Is the agm also a way to implement the incomplete elliptic integrals?

greetings
peaceglue
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)