Lockup Calculating Arc Length of Ellipse
10-16-2014, 07:24 PM
Post: #1
 mkspence Junior Member Posts: 12 Joined: Aug 2014
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.
10-16-2014, 07:41 PM (This post was last modified: 10-16-2014 07:46 PM by Tim Wessman.)
Post: #2
 Tim Wessman Senior Member Posts: 2,270 Joined: Dec 2013
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 the HP calculator group, the views and opinions I post here are my own.
10-16-2014, 07:59 PM (This post was last modified: 10-16-2014 08:00 PM by Mark Hardman.)
Post: #3
 Mark Hardman Senior Member Posts: 525 Joined: Dec 2013
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.

Attached File(s) Thumbnail(s)

Ceci n'est pas une signature.
10-16-2014, 08:08 PM
Post: #4
 parisse Senior Member Posts: 1,183 Joined: Dec 2013
RE: Lockup Calculating Arc Length of Ellipse
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...
10-17-2014, 04:16 AM
Post: #5
 Helge Gabert Senior Member Posts: 467 Joined: Dec 2013
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>]". ?
10-17-2014, 05:07 AM
Post: #6
 mkspence Junior Member Posts: 12 Joined: Aug 2014
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)
10-17-2014, 03:00 PM (This post was last modified: 10-17-2014 03:32 PM by Helge Gabert.)
Post: #7
 Helge Gabert Senior Member Posts: 467 Joined: Dec 2013
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?
10-20-2014, 08:10 AM
Post: #8
 Wes Loewer Senior Member Posts: 332 Joined: Jan 2014
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
10-20-2014, 02:20 PM (This post was last modified: 10-20-2014 03:53 PM by Helge Gabert.)
Post: #9
 Helge Gabert Senior Member Posts: 467 Joined: Dec 2013
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.
10-20-2014, 06:04 PM
Post: #10
 parisse Senior Member Posts: 1,183 Joined: Dec 2013
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.
10-20-2014, 09:44 PM
Post: #11
 Helge Gabert Senior Member Posts: 467 Joined: Dec 2013
RE: Lockup Calculating Arc Length of Ellipse
Sounds good; thanks for the info!
10-21-2014, 05:07 PM
Post: #12
 peacecalc Member Posts: 187 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

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