Question: How do I use ScientificConstants:-ModifyElement in a loop?

I am trying to add a specific property (radiation length) to the Elements in ScientificConstants.

To do this  I first 

ScientificConstants:-AddProperty(radiationlength); # this seems to work

I then load a table of element name - radiationLength pairs (it is really a bigger table but only these are of interest):

                       datatype=anything,delimiter="\t"); # works too

(I made the file using downloaded data).

I then want to fill the radiationlength properties for all elements for which I've got the value:

for i from 1 to LinearAlgebra:-RowDimension(data) do
  elemt:=data[i,1]; # the element name as a string
end do;

which fails with the error

Error, (in ScientificConstants:-ModifyElement) element ``H `` is not known

H is the first element in the table of radiation lengths so it is getting the right one.

At  issue is that somehow the element name (called descriptor in the Help files) does not seem to get properly evaluated. In fact I tried various ways "by hand", none except just the unevaluated element name (i.e H,He etc. worked).

There must be a way to set these in a loop. Does someone know how?


Mac Dude



Please Wait...