Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2222
| From | Peter Breitfeld <phbrf@t-online.de> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Iterative process using IsotopeData. |
| Date | 2011-05-09 10:18 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <iq8f0v$5qi$1@smc.vnet.net> (permalink) |
| References | <iq3ajr$ffl$1@smc.vnet.net> |
Guillermo Sanchez wrote:
> Dear group
>
> I would like a eleghant solution of this iterative process (perhaps
> using NestList or FoldList}:
>
> In[1]: First[IsotopeData["U238", "DaughterNuclides"]]
> Out[1]: "Thorium234"
> In[2]: First[IsotopeData[%, "DaughterNuclides"]]
> Out[2]:"Protactinium234"
> In[3]: First[IsotopeData[%, "DaughterNuclides"]]
> Out[3]: "Uranium234"
>
> and so on n times (the best solution would be if the process stop when
> find that there not more isotopes, that is when Out[n] = { })
>
> and them
>
> {"U238", "Protactinium234", "Uranium234", ...}
>
> Any help?
>
> Guillermo
>
Maybe something like this:
Most@NestWhileList[(First@IsotopeData[#, "DaughterNuclides"] &),
"U238", Head[#] == String &] // Quiet
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Iterative process using IsotopeData. Guillermo Sanchez <guillermo.sanchez@hotmail.com> - 2011-05-07 11:32 +0000 Re: Iterative process using IsotopeData. Peter Breitfeld <phbrf@t-online.de> - 2011-05-09 10:18 +0000
csiph-web