HP Forums

Full Version: Y to the x functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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

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.

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.

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

See response to the above message

thanks

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. ;-)

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?

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.

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

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

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

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??

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]

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.)

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

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

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.

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.

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

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

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.

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

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.

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

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