Integrals and singularities
05-06-2015, 05:10 PM (This post was last modified: 05-06-2015 08:09 PM by Marcio.)
Post: #1
 Marcio Senior Member Posts: 438 Joined: Feb 2015
Integrals and singularities
Hello

Does anyone know how to numerically solve integrals with singularities like this one below on the Prime or the 50g?

$\int_{0}^{a} \frac{1}{a^n-x^n} dx$

Assign $$a=2$$, $$n=3$$ and the Prime will reboot and erase data from the "stack" in texbook entry mode.

Thanks
05-06-2015, 08:55 PM
Post: #2
 Dirk. Junior Member Posts: 41 Joined: Mar 2015
RE: Integrals and singularities
Hm,
as far as I understand, the integral does not converge? So I'm not sure about the answer the calculator should give. Maybe I'm wrong, maybe I did something wrong or I did not understand? Perhaps you could explain some more details?

As far as I see, both, the 50g and the Prime, (and also my very old CASIO) deliver a result I would expect/I do understand. None of my calculators crashed.

Greetings
Dirk.
05-06-2015, 09:34 PM (This post was last modified: 05-06-2015 09:48 PM by Marcio.)
Post: #3
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Integrals and singularities
(05-06-2015 08:55 PM)Dirk. Wrote:  Hm,
as far as I understand, the integral does not converge? So I'm not sure about the answer the calculator should give. Maybe I'm wrong, maybe I did something wrong or I did not understand? Perhaps you could explain some more details?

As far as I see, both, the 50g and the Prime, (and also my very old CASIO) deliver a result I would expect/I do understand. None of my calculators crashed.

Greetings
Dirk.

In CAS settings, if 'Exact' is unchecked, the calc will crash after a few seconds, like 5 or 10, otherwise it will return $$+\infty$$.

What results did you get from the calculators you used? How long did it take for each to deliver the results?

Thanks

Marcio
05-06-2015, 09:48 PM (This post was last modified: 05-06-2015 09:50 PM by salvomic.)
Post: #4
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
RE: Integrals and singularities
I tried:

subst(subst(int(1/(a^n+x^n),x,0,a), a=2), n=3) and I got $$\int^{2}_{0}{\frac{1}{8-x^{3}}dx}$$ and evaluating this one I got \infty ($$\infty$$)...

Do you mean this?

No crash with firmware 6975...

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
05-06-2015, 09:51 PM
Post: #5
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Integrals and singularities
(05-06-2015 09:48 PM)salvomic Wrote:  No crash with firmware 6975...

Uncheck 'Exact' and see if it crashes!

Thanks

Marcio
05-06-2015, 09:54 PM
Post: #6
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
RE: Integrals and singularities
(05-06-2015 09:51 PM)Marcio Wrote:  Uncheck 'Exact' and see if it crashes!

Thanks

Marcio

unchecking "Exact" here Terminal gives "Adaptive method failures", then a strange result: [3488371061.16 2.84200102803]
???

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
05-06-2015, 10:01 PM (This post was last modified: 05-06-2015 10:03 PM by Marcio.)
Post: #7
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Integrals and singularities
(05-06-2015 09:54 PM)salvomic Wrote:
(05-06-2015 09:51 PM)Marcio Wrote:  Uncheck 'Exact' and see if it crashes!

Thanks

Marcio

unchecking "Exact" here Terminal gives "Adaptive method failures", then a strange result: [3488371061.16 2.84200102803]
???

Mine says the same but the result that appears on the terminal is a bit different from yours, 2.94669952117, then it crashes in both Home and CAS views.
05-07-2015, 06:06 AM
Post: #8
 parisse Senior Member Posts: 1,315 Joined: Dec 2013
RE: Integrals and singularities
Indeed. Will be fixed today in giac source code.
05-07-2015, 03:56 PM
Post: #9
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Integrals and singularities
(05-07-2015 06:06 AM)parisse Wrote:  Indeed. Will be fixed today in giac source code.
I think the crash was caused by memory management issues. The Prime did return results and I managed to prove they're correct.
If it makes you feel any better, Wolfram Alpha did not return a thing.
05-07-2015, 04:36 PM
Post: #10
 parisse Senior Member Posts: 1,315 Joined: Dec 2013
RE: Integrals and singularities
The problem occured because the adaptative method (computing the integral) fails, therefore Romberg method is called. If the function is undefined at an endpoint, then the algorithm tries to find the limit there. And limit is not protected against approx input.
This is now fixed in giac source (I have no idea if/when it will be fixed for the Prime).
05-07-2015, 06:10 PM (This post was last modified: 05-07-2015 06:13 PM by Marcio.)
Post: #11
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Integrals and singularities
Well, it seemed to me that the Prime CAS handled the situation fairly well. The problem, however, was (still is) that the machine can't handle memory demanding operations. It crashed both the calculator and the emulator. The emulator took longer to crash because it's backed up by a PC. The 50g took about 30 min to deliver the result, which was not as accurate, but at least it did not crash.
05-08-2015, 06:26 AM
Post: #12
 parisse Senior Member Posts: 1,315 Joined: Dec 2013
RE: Integrals and singularities
The hp50g has a much better error handling system than the Prime. You can throw the equivalent of a c++ exception everywhere in the hp50g code. This made coding much safer, I really miss this functionnality and that explains why sometimes you can't interrupt a computation or it eventually crashes.
It does not mean the 50g is bugfree, there are CAS bugs there, but you will probably never hit them because you won't have the patience to wait. On the other hand, the Prime is constantly improving, at some point in the near future it will be as reliable as the ancient code of the 48g series, but able to solve much more.
05-13-2015, 10:24 PM
Post: #13
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
RE: Integrals and singularities
(05-06-2015 10:01 PM)Marcio Wrote:  Mine says the same but the result that appears on the terminal is a bit different from yours, 2.94669952117, then it crashes in both Home and CAS views.

Marcio, uncheking "exact" now in 7820 in CAS I get [0.938556... 2.87166...] after that the terminal wrote "Adaptive method failure, will try with Romberg, last approxmiation was 2.87166029039..."

Is it better than first?

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
05-13-2015, 10:45 PM
Post: #14
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: Integrals and singularities
(05-13-2015 10:24 PM)salvomic Wrote:
(05-06-2015 10:01 PM)Marcio Wrote:  Mine says the same but the result that appears on the terminal is a bit different from yours, 2.94669952117, then it crashes in both Home and CAS views.

Marcio, uncheking "exact" now in 7820 in CAS I get [0.938556... 2.87166...] after that the terminal wrote "Adaptive method failure, will try with Romberg, last approxmiation was 2.87166029039..."

Is it better than first?

Salvo
Well, yes, at least it didn't crash like before.
 « Next Oldest | Next Newest »

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