HP Forums

Full Version: RPL integral : 28S vs 48GX (fail to call a program)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 ?
? 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
(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.
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
(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))'
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).
Reference URL's