HP Forums

Full Version: ? RPL/HP-48 - numerical S on a << >> integrand ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In RPL, is there a way to integrate (S) on a program <<...>> integrand ? I don't think so,
Something like this :
0
1
<<X SIN X SQ - >>
'X'
S
where the legal way to integrate is :
0
1
'SIN(X)-SQ(X)'
'X'
S

a program gives sometimes more flexibility to build a function to integrate.
(08-05-2021 12:52 PM)OlidaBel Wrote: [ -> ]In RPL, is there a way to integrate (S) on a program <<...>> integrand ? I don't think so,
Something like this :
0
1
<<X SIN X SQ - >>
'X'
S
where the legal way to integrate is :
0
1
'SIN(X)-SQ(X)'
'X'
S

a program gives sometimes more flexibility to build a function to integrate.

Try writing the program as a "user-defined function" which means storing the argument(s) in local variable(s) like this:

<< -> X << X SIN X SQ - >> >>
or
<< -> X 'SIN(X)-X^2' >>

RPL treats programs like that more like built-in functions when solving, graphing, and so on, so it might help here too.
(08-05-2021 01:27 PM)Joe Horn Wrote: [ -> ]Try writing the program as a "user-defined function" which means storing the argument(s) in local variable(s) like this:

<< -> X << X SIN X SQ - >> >>
or
<< -> X 'SIN(X)-X^2' >>

RPL treats programs like that more like built-in functions when solving, graphing, and so on, so it might help here too.

Unfortunately something like this is refused on HP 48GX :
0
1
<< -> X 'SIN(X)-X^2' >> or << -> X << X SIN X SQ - >> >>
'X'
S
=>
"S Error:
Bad argument type"

I checked the old HP-28s documentation. This calculator was more permissive with S.
But this is accepted :
EQ = 'EQ1(X)'
EQ1 = << -> T << T SIN T SQ - >> >>

0
1
'EQ1(X)'
'X'
S
=>
0.12636
You can use
\<< <-X SIN <-X SQ - \>> 'F' STO
0.
1.
'F'
'<-X'
S

with <- the backarrow symbol, declaring a local variable.

If you don't like that, you'll have to do it the way Olidabel did

Cheers, Werner
Thanks Joe & Werner,
I finally succeeded (and understood!) how to play with integrals S onto programs. I could adapt my old 28S program and results are now OK.
The 48GX is definitely different than a 28S, it was not easy to troubleshoot ;-).
Starting with an algebraic expression and playing with local variables in <<...>> was the key.
Reference URL's