HP Forums

Full Version: Lockup Calculating Arc Length of Ellipse
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Works fine here (hw/emu), so I suspect that has been resolved with later CAS versions. Returns 9.68844822
(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]
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...
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>]". ?
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)
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-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
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.
I don't plan to implement elliptic integrals now. Perhaps in the future, using the arithmetic-geometric mean.
Sounds good; thanks for the info!
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
Reference URL's