Do you know what atomic decay series are?
Yes
 57%  [ 4 ]
No
 42%  [ 3 ]
Total Votes : 7

In Chemistry we're learning about something called atomic decay series. If you don't know what this is please find out.

Actually, a full knowledge of this field of Chemistry is not really needed. My coding problem is that I am supposed to run the first loop section until the variable P is below or equal to 83. Once that happens the second loop runs, which adds 1 to P if (M-P)/P is above 1.51.

Anyways, I'm trying to make a program for it, but it's proving to be much harder than I expected.


Code:

ClrHome

"TLPBBIPOATRNFRRAACTHPAU NPPUAMCMBKCFES"->Str1
0->S

Disp "INPUT ELEMENT","(ATOM. NUM) AND","MASS NUMBER"
Input "MN: ",M
Input "E: ",P
ClrHome

Output(4,1,M
Output(6,1,P
Output(5,2,sub(Str1,2(P-80)-1,2

While P>83 and ((M-P)/P)>1.51

   While P>83
   
      Output(1,1,"ALPHA DECAY
      Output(2,1,"Z>83
      Output(4,1,M
      Output(6,1,P
      Output(5,2,sub(Str1,2(P-80)-1,2
      Output(5,5,"--->
      Output(4,9,"4
      Output(6,9,"2
      Output(5,9,"A +
      M-4->M
      P-2->P
      Output(4,13,M
      Output(6,13,P
      Output(5,14,sub(Str1,2(P-80)-1,2
      S+1->S
      Output(8,1,S
      Output(8,4,"STEPS TAKEN
      Pause
   End

   While ((M-P)/P)>1.51
      If P>83
         End
      Output(1,1,"BETA DECAY
      Fix 2
      Output(2,1,(M-P)/P
      Float
      Output(2,6,"N::P
      Output(4,1,M
      Output(6,1,P
      Output(5,2,sub(Str1,2(P-80)-1,2
      Output(5,5,"--->
      Output(4,9,"0
      Output(6,9,"-1
      Output(5,9,"B +
      P+1->P
      Output(4,13,M
      Output(6,13,P
      Output(5,14,sub(Str1,2(P-80)-1,2
      S+1->S
      Output(8,1,S
      Output(8,4,"STEPS TAKEN
      Pause
   End
End
ClrHome
Output(1,1,S
Output(3,1,"STEPS TAKEN.
Pause :ClrHome


I have a feeling that I shouldn't be using a while loop for the beta decay. However, I'm not sure exactly what I should do.

Since alpha decay has priority over beta decay, the loop for beta decay has to run until the proton count exceeds 83. But I can't find a way to cut the beta decay loop without stopping the entire program.

The above code works, but it runs the beta decay loop twice and then the program stops, presumably in an infinite loop.

For testing I have been using Thorium-232.

Please let me know if I can get some help.
*bump* This topic has now been sitting in my browser for over two months, which is truly ridiculous. If the original poster hasn't already solved this, any ideas for him? Silverwings, where do you think it's getting stuck?
I really have no clue. That unit in Chemistry at school is long past so I don't need to fix it anymore, but nowadays I'm trying to fix it out of pure curiosity.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement