HP Forums
RPL integral : 28S vs 48GX (fail to call a program) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: RPL integral : 28S vs 48GX (fail to call a program) (/thread-19691.html)



RPL integral : 28S vs 48GX (fail to call a program) - OlidaBel - 03-21-2023 09:08 AM

Hello RPL'ers Smile ,
I noticed an annoying difference for calculating numerical integrals in RPL between 28S and 48GX.

I create an equation for the integration: EQ1. This equation calls a small RPL program ('F1') where the integration variable (here 'Y') is also used. I simplified the scenario here, but I had this problem in a much larger application.
The 28S does this very well, while the 48GX does not.
The 48GX does not want to understand that the 'Y' is the same as the Y for the integral.

If anyone can figure out why the 48GX can't do it...or show me how.
Rem1: on a Swissmicros DM42, I can carry out this scenario without problem. This machine is still wonderful.
Rem2: syntax on the 28S was different than the syntax on the 48GX

28S:
EQ1 : 'F1(Y^2)'
F1: << -> x 'x*Y' >> (x is a local variable)
the stack before the command:
3: 'EQ1'
2: {Y 0.5 1}
1: 0.001 (accuracy)
integral command : S

answer 28S:
2: 0.234 (integral)
1: 2.34E-4 (error)

48GX : (flag -3 Set : numerical result)
EQ1: 'F1(Y^2)'
F1: << -> x 'x*Y' >> (x is a local variable)
the stack before the command:
4: 0.500
3: 1.00
2: 'EQ1'
1: 'Y'
integral command : S

answer 48GX:
^Error:
Undefined Name


What's happening here ?


RE: RPL integral : 28S vs 48GX (fail to call a program) - Werner - 03-21-2023 09:45 AM

? Works for me, at least when I specify
F1: \<< \-> x 'x*Y' \>>
instead of 'x.Y', and I purge the variables 'x' and 'Y'.

Cheers, Werner


RE: RPL integral : 28S vs 48GX (fail to call a program) - OlidaBel - 03-21-2023 09:53 AM

(03-21-2023 09:45 AM)Werner Wrote:  ? Works for me, at least when I specify
F1: \<< \-> x 'x*Y' \>>
instead of 'x.Y', and I purge the variables 'x' and 'Y'.

Cheers, Werner
on a 48GX ?
in my text above, "." stands for "*" off course. I updated my post.
I can't understand though.


RE: RPL integral : 28S vs 48GX (fail to call a program) - Werner - 03-21-2023 10:18 AM

tbh, on iHP48 running a 49G in approx mode. Should be the same.
But I'll be sure to try it on my 48GX tonight.

Update: hold your horses! Flag -3 Set is the culprit, for some reason.
I had it Clear, then it works, but when Set it fails. Hmm
Werner


RE: RPL integral : 28S vs 48GX (fail to call a program) - OlidaBel - 03-21-2023 11:06 AM

(03-21-2023 10:18 AM)Werner Wrote:  tbh, on iHP48 running a 49G in approx mode. Should be the same.
But I'll be sure to try it on my 48GX tonight.

Update: hold your horses! Flag -3 Set is the culprit, for some reason.
I had it Clear, then it works, but when Set it fails. Hmm
Werner

I forgot to test it on iHP48 (iPhone), standard behaviour (rom.48g).
I don't use this (good) emulator since I know Plus42 ;-)
I get the same error than above (with System Flag 03: Numerical)

With system Flag 03 -> symb : result of the integral gives :
1: 'EQ1*Y|(Y=1)-(EQ1*Y|(Y=.5))'


RE: RPL integral : 28S vs 48GX (fail to call a program) - jonmoore - 05-03-2023 01:27 PM

AFAIK, the 49/50g integral routines are different than those in the 48 series. The 49/50 series use improved versions of the Erable/ALG-48 integral routines that were available as third party addons for the 48 series.

Whether the 28S and 48's default integral routines are the same, that's less obvious. These days I use my 50g or Prime G2 for most CAS duties. I enjoy programming numeric stuff on my 28S as I love its form factor, but it's symbolic capabilies are too limited (although it was arguably the first handfeld calculator to feature symbolic math capabilities, and that made it best in class when the 28C was first released).