HP Forums
sum_riemann() error - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: sum_riemann() error (/thread-11210.html)



sum_riemann() error - JDW - 08-12-2018 06:18 AM

The following is a Riemann sum:

sum_riemann(k^2/n^3,[n,k])

The expected correct answer is 1/3. However, my Prime gives me the following error when I press the CAS button and then type the sum above and press ENTER:

"sum_riemann(k^2/n^3,[n,k]) Error: Bad Argument Type"

My CAS settings:
Angle Measure: Radians
Number Format: Standard, 12
Integers: Decimal, checkmarked
Simplify: Minimum
Exact: Checkmarked
Use SQRT: Checkmarked
Principal: Checkmarked
Complex: no checkmark
Use i: Checkmarked
Increasing: no checkmark


About HP Prime:
Software Version: 2.0.0.13865
Hardware Version: C
CAS Version: 1.4.9
Serial Number: 9CJ7280CZG
OS: V0.050.640


But when I use Virtual Prime on my 2015 15" MacBook Pro, it immediately gives me 1/3 with no error. I am using the following Virtual Prime:
Software Version: 2.1.13952
Hardware Version: Emu
CAS Version: 1.4.9
Serial Number: BE34DB8359EA66E
OS: macOS High Sierra( (10.13)


Virtual Prime uses the same CAS Settings as my actual Prime.

Please advise why my handheld Prime calculator fails with an error while Virtual Prime has no problem with it.


RE: sum_riemann() error - Didier Lachieze - 08-12-2018 06:36 AM

On my physical Prime (same version and same CAS settings) I get the correct answer: 1/3.

You can try purge(k,n) and see if it helps.


RE: sum_riemann() error - JDW - 08-12-2018 06:47 AM

(08-12-2018 06:36 AM)Didier Lachieze Wrote:  You can try purge(k,n) and see if it helps.

When I type purge(k,n) and then press ENTER, my physical Prime says:

["No such variable k" "No such variable n"]

(But Virtual Prime also says that too.)

When I try the sum_riemann again on my physical Prime, I get the same Error: Bad Argument. So "purge" does nothing to resolve the problem.


RE: sum_riemann() error - ijabbott - 08-12-2018 01:35 PM

(08-12-2018 06:47 AM)JDW Wrote:  
(08-12-2018 06:36 AM)Didier Lachieze Wrote:  You can try purge(k,n) and see if it helps.

When I type purge(k,n) and then press ENTER, my physical Prime says:

["No such variable k" "No such variable n"]

(But Virtual Prime also says that too.)

When I try the sum_riemann again on my physical Prime, I get the same Error: Bad Argument. So "purge" does nothing to resolve the problem.

How about the "restart" CAS command?

I tried to reproduce the problem on my Prime (same software and hardware version as yours), but failed to do so.


RE: sum_riemann() error - JDW - 08-12-2018 03:00 PM

(08-12-2018 01:35 PM)ijabbott Wrote:  How about the "restart" CAS command?

Thank you. That fixed the problem.

I should mention one related thing though. If I press Blue-Shift and then the CAS button and checkmark "Complex" and then enter "sum_riemann(k^2/n^3,[n,k])" I get sent to the Terminal that shows "Warning, complex variables is set, this can lead to fairly complex answers. It is recommended..." The bug here seems to be that the same Warning message is repeated twice, for no apparent reason at all. I can reproduce it on Virtual Prime too. You should see if you can reproduce it.

Thanks again.


RE: sum_riemann() error - ijabbott - 08-12-2018 08:43 PM

(08-12-2018 03:00 PM)JDW Wrote:  I should mention one related thing though. If I press Blue-Shift and then the CAS button and checkmark "Complex" and then enter "sum_riemann(k^2/n^3,[n,k])" I get sent to the Terminal that shows "Warning, complex variables is set, this can lead to fairly complex answers. It is recommended..." The bug here seems to be that the same Warning message is repeated twice, for no apparent reason at all. I can reproduce it on Virtual Prime too. You should see if you can reproduce it.

Yes, I can reproduce it. Perhaps it is outputting the warning once per variable instead of once per expression?


RE: sum_riemann() error - JDW - 08-13-2018 12:17 AM

(08-12-2018 08:43 PM)ijabbott Wrote:  Yes, I can reproduce it. Perhaps it is outputting the warning once per variable instead of once per expression?

Actually, I just tested it again and that Warning in the Terminal is actually repeating 3 times. But only n & k are used in the sum.

Regardless, because the reason for the triple repeated warning is not made clear, it seems to be more of a bug than a useful warning implementation. I would thing this is something HP should fix in a firmware update. For truly, how does the same exact triple warning help us? It doesn't. It only looks like something is broken.


RE: sum_riemann() error - Aries - 08-13-2018 09:28 AM

[Image: riemsum.jpg]upload picture

Best and happy August holidays,

Aries Wink


RE: sum_riemann() error - toml_12953 - 08-13-2018 03:29 PM

(08-13-2018 12:17 AM)JDW Wrote:  
(08-12-2018 08:43 PM)ijabbott Wrote:  Yes, I can reproduce it. Perhaps it is outputting the warning once per variable instead of once per expression?

Actually, I just tested it again and that Warning in the Terminal is actually repeating 3 times. But only n & k are used in the sum.

I only get two copies of the warning. It must be some important warning! Smile


RE: sum_riemann() error - Komanguy - 08-15-2018 02:10 PM

(08-13-2018 09:28 AM)Aries Wrote:  [Image: riemsum.jpg]upload picture

Best and happy August holidays,

Aries Wink


[Image: 9_F275106-61_F5-4_BFC-88_E6-950297_D1_DDBB.jpg]

Thanks a lot,
Guyzo Wink


RE: sum_riemann() error - parisse - 08-15-2018 08:40 PM

To Aries:
sum_riemann is interesting when the sum does not have a closed form. Here it has, and of course the Prime does solve limit(sum(k^2/n^3,k,1,n),n,inf) (returns 1/3).
It's probably a good idea to check before promoting the nspire in a lot of CAS related threads.