Message Boards Message Boards

Mass material property query from online databases

Posted 10 years ago
POSTED BY: Edward Brelsford

Here is an approach for items that are in Mathematica's MineralData curated data. This is for the first 20 in the list given by executing

MineralData[]

Here is the example:

In[1]:= hardnessData = 
 Map[MineralData[#, {EntityProperty["Mineral", "Name"], 
     EntityProperty["Mineral", "Hardness"]}] &, 
  MineralData[][[1 ;; 20]]]

Out[1]= {{"antimony", 3.25}, {"arsenic", 3.5}, {"bismuth", 
  2.25}, {"cadmium", 3/2}, {"chromium", 7.5}, {"copper", 
  2.75}, {"gold", 2.75}, {"indium", 3.5}, {"iridium", 13/2}, {"iron", 
  9/2}, {"lead", 2.25}, {"mercury", 0}, {"nickel", 9/2}, {"osmium", 
  13/2}, {"palladium", 4.75}, {"platinum", 4.25}, {"rhenium", 
  Missing["NotAvailable"]}, {"rhodium", 3.5}, {"ruthenium", 
  6.5}, {"selenium", 2}}

In[2]:= hardnessData = DeleteCases[hardnessData, {_, Missing[___]}]

Out[2]= {{"antimony", 3.25}, {"arsenic", 3.5}, {"bismuth", 
  2.25}, {"cadmium", 3/2}, {"chromium", 7.5}, {"copper", 
  2.75}, {"gold", 2.75}, {"indium", 3.5}, {"iridium", 13/2}, {"iron", 
  9/2}, {"lead", 2.25}, {"mercury", 0}, {"nickel", 9/2}, {"osmium", 
  13/2}, {"palladium", 4.75}, {"platinum", 4.25}, {"rhodium", 
  3.5}, {"ruthenium", 6.5}, {"selenium", 2}}

In[3]:= hardnessData = 
 hardnessData /. {name_, value_} -> {name, N[value]}

Out[3]= {{"antimony", 3.25}, {"arsenic", 3.5}, {"bismuth", 
  2.25}, {"cadmium", 3/2}, {"chromium", 7.5}, {"copper", 
  2.75}, {"gold", 2.75}, {"indium", 3.5}, {"iridium", 13/2}, {"iron", 
  9/2}, {"lead", 2.25}, {"mercury", 0}, {"nickel", 9/2}, {"osmium", 
  13/2}, {"palladium", 4.75}, {"platinum", 4.25}, {"rhodium", 
  3.5}, {"ruthenium", 6.5}, {"selenium", 2}}

You can then export this table of {name, value} to Excel by using Export as in

In[4]:= Export["/Users/dreiss/Desktop/hardness.xls", hardnessData]

Out[4]= "/Users/dreiss/Desktop/hardness.xlsx"

Giving an XLSX file that opens to

enter image description here

The other curated data sources of interest are listed here:

https://reference.wolfram.com/language/guide/PhysicsAndChemistryDataAndComputation.html

I haven't done much of this sort of computation yet with Mathematica 10, so this is just an outline of an approach. Others may have some more detailed and useful additional information.

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract