The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Y to the x functions
Message #1 Posted by Mark Berg on 3 Feb 2004, 5:30 p.m.

I am taking a college class and the instructor asked the students to buy a calculator that has y to the x key on it for figuring out decay of radioactive. Problem would take half life and the amount of days since it was new to get the Curies for that date so a time can be calculated for exposer to the x ray film. Can my HP 28S do that? email me at markberg@sctelcom.net

Edited: 3 Feb 2004, 5:41 p.m. after one or more responses were posted

      
Re: Y to the x
Message #2 Posted by Eric Smith on 3 Feb 2004, 5:41 p.m.,
in response to message #1 by Mark Berg

If memory serves, on the HP-28C and HP-28S exponentiation is done by the "^" function which is the shift of the multiply key. So for instance the sequence "2 ENTER 3 ^" should produce 8.

If you like, you can use space rather than ENTER and fit this all on the command line.

            
Re: Y to the x
Message #3 Posted by Mark Berg on 3 Feb 2004, 5:48 p.m.,
in response to message #2 by Eric Smith

Thanks, but I guess I ddin't give enough info in my question. formula for calculation is Source Now = source in Ci when it was new then divided by 2 then press the y to the x key... that is y^x.... on the TI calculator then ( enter days since new divided by half life then ) then =

numbers to use in the formula 162/2 then ( 360/75) = 5.815

it is a decaying function

Edited: 3 Feb 2004, 5:56 p.m.

                  
What is the exact question?
Message #4 Posted by Jim L on 3 Feb 2004, 6:54 p.m.,
in response to message #3 by Mark Berg

The ^ key is equivalent to the y^x key. I had trouble understanding your description but I eventually got 5.815. Do you know RPN? If not, it's an entirely different question. ;-)

                        
Re: What is the exact question?
Message #5 Posted by mark berg on 3 Feb 2004, 6:59 p.m.,
in response to message #4 by Jim L

THANKS!! I knew someone out there could get the old HP to do what he cheap YTi can do. Yes I know or thnk I know RPG. I love it as entering data to work o n is easier, What key strokes dir U use? did you use the log menu or how did U get it?

                              
Re: What is the exact question?
Message #6 Posted by Jim L on 3 Feb 2004, 7:05 p.m.,
in response to message #5 by mark berg

RPG? Doesn't that involve dungeons or something ;-)

Here's one way

162 Enter 2 Enter 360 Enter 75 / ^ /

Result: 5.815

Of course, there are other ways too. This one's not very stack efficient but on a 28S we don't have to worry.

                                    
Thanks
Message #7 Posted by mark berg on 3 Feb 2004, 7:09 p.m.,
in response to message #6 by Jim L

I knew it was possible, but I don't use the HP for much more then add subtract multiple and divide. I don't program with it

Thanks again

                                    
RPG, RPL, RPN (and RPM)
Message #8 Posted by Ernie Malaga on 3 Feb 2004, 7:16 p.m.,
in response to message #6 by Jim L

Quote:
RPG? Doesn't that involve dungeons or something ;-)

Actually, RPG involves indicators and F, D, I, C and O specifications. If this dates me, there's nothing I can do about it.

RPG started in the 1960s, I think on the System/360, as a rather primitive programming language for mainframes and medium-sized computers. It's evolved through the years (40 years old!) to the point where a modern RPG program would be quite unintelligible to a System/360 programmer.

Those were the days... 8^)

-Ernie

                                          
RPG
Message #9 Posted by Wayne Stephens on 3 Feb 2004, 8:10 p.m.,
in response to message #8 by Ernie Malaga

I thought RPG stood for "Rocket Propelled Grenade".

None of my HP calculators has one of those.

I heard the Soviets had one, though, some time in the '80s??

                                                
Re: RPG
Message #10 Posted by Les Bell [Sydney] on 3 Feb 2004, 10:58 p.m.,
in response to message #9 by Wayne Stephens

Quote:
I thought RPG stood for "Rocket Propelled Grenade".

Report Program Generator, if memory services. . . It's one of the few languages I never picked up, and never felt the inclination to. It couldn't be worse than JCL, though . . .

Best,

--- Les [http://www.lesbell.com.au]

                                                      
Re: RPG
Message #11 Posted by Vassilis Prevelakis on 4 Feb 2004, 6:20 a.m.,
in response to message #10 by Les Bell [Sydney]

Les Bell [Sydney] wrote:
> Report Program Generator, if memory services. . . It's one of the few languages I never picked up, 
> and never felt the inclination to. It couldn't be worse than JCL, though . . .

You don't know how lucky you are :-)

RPG is nothing like JCL, its a programming language for accountants. You program by filling in forms. I think there are about 9-10 different forms you can fill to describe reading-in data, processing, and finally printing.

The language has a built-in loop that goes like

	while (input) {
		process instructions from form 1
		process instructions from form 2
		...
		process instructions from form n
	}
	exit

Why did you have to remind me all this? :-)

**vp

                                                            
Re: RPG
Message #12 Posted by Wayne Stephens on 4 Feb 2004, 7:30 a.m.,
in response to message #11 by Vassilis Prevelakis

That doesn't sound like very much fun at all.

                                                                  
Re: RPG
Message #13 Posted by Mark Hardman on 4 Feb 2004, 9:50 p.m.,
in response to message #12 by Wayne Stephens

RPG is a nasty old language that is actually derived from the really really really old days when "accounting machines" were programmed with wire wrap boards. RPG programmers still find a market niche in shops using the IBM AS/400.

As a special "treat", here is a fragment of actual RPG code pulled off a rarely used AS/400 in our shop.

Can you say "ancient procedural language?"

Mark Hardman

0073 IVENMST  CC  04
0074 I                                        1   1 DEL
0075 I                                        5  34 VNAME
0076 I                                       35  64 ADDRSS
0077 I                                       65  79 CITY
0078 I                                       80  89 STATE
0079 I                                    P  90  920ZIP
SGS01I                                      139 168 ADDR2           15
0080 I*PTRAN  DD  05
0081 ICDOUT   EE  06
0082 ICOMST   FF  08
     I                                    P   2   30CONO
0083 I                                        4  33 CONAM
0084 C   22                GOTO DARD
0085 C                     MOVELUMONTH    MODAY   40
0086 C                     MOVE UDAY      MODAY
0087 C                     MOVE MODAY     UYMD    60
0088 C                     MOVELUYEAR     UYMD
0089 C                     SETON                     22
0090 C           DARD      TAG
BB01 C                     SETOF                     60

Edited: 4 Feb 2004, 9:52 p.m.

                                          
Re: RPG
Message #14 Posted by Paul Brogger on 4 Feb 2004, 9:47 a.m.,
in response to message #8 by Ernie Malaga

I often said about RPG what I also said about COBOL: "I burned that bridge in front of me!" (I.e., the 70's version of "Don't go there".)

Of course, it's all relative: I'm only now moving from mainframe PL/I & Assembler to Java, etc.

      
Re: Y to the x
Message #15 Posted by James M. Prange on 3 Feb 2004, 5:50 p.m.,
in response to message #1 by Mark Berg

Sure. Use the ^ command; it's on the shifted X ("multiply" or "*" command, not the letter).

2 3 ^ returns 8, as does '2^3' EVAL.

Regards,
James

            
Re: Y to the x
Message #16 Posted by mark berg on 3 Feb 2004, 5:52 p.m.,
in response to message #15 by James M. Prange

See response to the above message

thanks

      
Radioactive decay problems
Message #17 Posted by Tom Sherman on 3 Feb 2004, 8:02 p.m.,
in response to message #1 by Mark Berg

Mark,

If you have an HP-28S, you can set up the solver to handle any radioactive decay problem that the book or your instructor may throw at you.

Go to the solver and type in the equation: MORE=LESS*2^(TIME/HFTM), where HFTM stands for half-time.

Store this as a variable (I use EXPN, for exponential), and also store it as your current equation in the Solver. Then ask the solver to solve it. You give any three of the four variables (MORE, LESS, TIME, HFTM), and the solver will find the fourth.

For a decay problem, LESS will be the amount remaining after a period of time, and MORE will be the starting amount. For a growth problem, the reverse will hold. Whatever a problem is, it will have to give you three of the factors, and ask you for the other. So you can use the one equation to solve all four kinds of possible problems.

If you work with decay constants instead of half-lives, you can modify the equation to read:

MORE=LESS*EXP^(TIME/TRTM), where TRTM stands for turnover time = 1.44 x halftime = 1/(decay constant).

You can also use these equations for any other problems involving exponential growth or decay: e.g. microbial population growth, absorption of electromagnetic radiation by matter, discharge of a capacitor.

Tom

            
Re: Radioactive decay problems
Message #18 Posted by Bert K on 6 Feb 2004, 4:10 p.m.,
in response to message #17 by Tom Sherman

Tom shouldn't it read LESS=MORE * 2^ -(TIME/HFTM) ?

For example the activity 300 MBq of Tc99m (half-life of 6 hours) after 6 hours of decay would give:

LESS=300 * 2^ -(6/6) LESS=300 * 2^ -(1) LESS=300 * 0.5 LESS=150 MBq

                  
Re: Radioactive decay problems
Message #19 Posted by Tom Sherman on 6 Feb 2004, 5:27 p.m.,
in response to message #18 by Bert K

Hi Bert,

Both expressions, yours and mine, are correct, for the one is a rearrangement of the other (that is, they are the same expression, differently arranged). For those who want the variable they are solving for to be on the left hand side of the equation, then you have put it in the right form for radioactive decay (assuming one knows the starting amount and wants to calculate the amount after decay).

But part of the (indecent!) power of the solver is that it does not care which variable is isolated on the left hand side of the equation. In this example, it can solve for MORE or LESS or TIME or HALFTIME if it is given the other three, and it does not matter which, if any, is on the left hand side. It would work just as well, for example, if we expressed it as: 0=MORE-LESS*2^(TIME/HFTM), or as 0=MORE*2^-(TIME/HFTM)-LESS.

I happen to like to keep the exponent positive and put it in the form of MORE=LESS*2^(TIME/HFTM). The beauty of any form is that, if correctly expressed, it will work for any exponential process -- with appropriate interpretation of what the four factors are (in the absorption of light, for example, the dimension of length or length x concentration would replace that of time).

Does this make any sense?

Cheers,

Tom

                        
Re: Radioactive decay problems
Message #20 Posted by Bert K on 7 Feb 2004, 6:27 a.m.,
in response to message #19 by Tom Sherman

Tom you are right, both represent the same equation. I figured that out while trying to sleep last night...

I have stored "my version" of the equation in my 32SII. It proved to be very useful for when the company computer network was down.

                              
Re: Radioactive decay problems
Message #21 Posted by Victor Koechli on 7 Feb 2004, 11:15 a.m.,
in response to message #20 by Bert K

I can't stop wondering what your company's network downtime has to do with the radioactive decay problem. Are you trying to find out how many bits survive the outage, given the average survival time of a bit with no network to feed on ;-)

Cheers, Victor

12345 to delete

                                    
Re: Radioactive decay problems
Message #22 Posted by Bert K on 7 Feb 2004, 11:35 a.m.,
in response to message #21 by Victor Koechli

If you like me have to calculate the decay of Tc99m (with a half-life of 6 hours, so decay IS a factor to take into account) when the Excell-application that's located on the network is inaccessible and you've got hospital patients waiting for a Tc99m injection then having the radio active decay equation programmed into a calculator is very convenient.

                                          
Re: Radioactive decay problems
Message #23 Posted by Tom Sherman on 7 Feb 2004, 2:09 p.m.,
in response to message #22 by Bert K

Bert,

What a great application! So good to hear.

Forty years ago (Lord, has it been that long?) I taught a laboratory course on the applications of radioisotopes to biology and medicine. All the calculations were done by hand, with log tables, log paper, and slide rules. The electronic calculator -- especially with the solver routine -- just doesn't seem fair, but it certainly is nice, so long as our brains can still see the math while falling asleep at night!

Cheers, Tom

            
Ra - di - o - ac - ti - vi - ty (if you like mathematical analisys)
Message #24 Posted by Tizedes Csaba on 8 Feb 2004, 1:50 p.m.,
in response to message #17 by Tom Sherman

If the decrease of mass is proportionate with mass:

dm/dt=-k*m ; where k>0

separate, then integrate it, with this starting condition: if t=t0, then m:=m0

INTEGRATE(FROM m0,TO m,1/m,BY m)=INTEGRATE(FROM t0,TO t,-k,BY t)

so, we get:

LN(m/m0)=-k*(t-t0)

+---------------------+ | m=m0*EXP(-k*(t-t0)) | +---------------------+

And the value of k:

if the time is equal with half-time (thalf), then mass is equal with m0/2:

m0/2=m0*EXP(-k*(thalf-t0))

so, value of k:

+----------------------------------------------+ | k=LN(2)/(thalf-t0)= about =0.6931/(thalf-t0) | +----------------------------------------------+

Csaba

      
Re: Y to the x functions
Message #25 Posted by David Ramsey on 4 Feb 2004, 1:12 a.m.,
in response to message #1 by Mark Berg

Good God, doesn't anyone teach math any more?

Even if you couldn't find the x^y function on your 28 (it is rather subtle), just hit the LOGS key. Then enter 2, take the log, multiply by 3, take the antilog...

(Anyone who'd ever used a slide rule would know this. I am dating myself.)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall