Science_Chemistry
[ class tree: Science_Chemistry ] [ index: Science_Chemistry ] [ all elements ]

Source for file Periodic_Table.php

Documentation is available at Periodic_Table.php

  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net>                |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id$
  20. //
  21.  
  22. require_once "Science/Chemistry.php";
  23.  
  24. /** 
  25.  * Utility class that defines a Periodic Table of elements
  26.  *
  27.  * @author  Jesus M. Castagnetto <jmcastagnetto@php.net>
  28.  * @version 1.0
  29.  * @access  public
  30.  * @package Science_Chemistry
  31.  */
  32.  
  33.     /**
  34.      * The associative array containing the chemical elements
  35.      *
  36.      * @var     array 
  37.      * @access  public
  38.      */
  39.     var $periodic_table = array();
  40.  
  41.     /**
  42.      * Returns a Science_Chemistry_Element object correspoding to the symbol (case sensitive)
  43.      *
  44.      * @param   string  $symbol 
  45.      * @return  object Science_Chemistry_Element 
  46.      * @access  public
  47.      */
  48.     function getElement($symbol{
  49.         if (empty($this->periodic_table))
  50.             $this->initTable();
  51.         $elem $this->periodic_table[$symbol];
  52.         if (Science_Chemistry_Element::isElement($elem))
  53.             return $elem;
  54.         else
  55.             return null;
  56.     }
  57.  
  58.     /**
  59.      * Returns an array of Science_Chemistry_Element objects belonging to an element family
  60.      *
  61.      * @param   string  $family 
  62.      * @return  array   Science_Chemistry_Element objects
  63.      * @access  public
  64.      */
  65.     function getElementFamily($family{
  66.         if (empty($this->periodic_table))
  67.             $this->initTable();
  68.         $elemlist = array();
  69.         foreach ($this->periodic_table as $sym=>$elem)
  70.             if ($elem->family == $family)
  71.                 $elemlist[$sym$elem;
  72.         return $elemlist;
  73.     }
  74.  
  75.     /**
  76.      * Initializes the Periodic Table array
  77.      *
  78.      * @access  public
  79.      */
  80.     function initTable({
  81.         $periodic_table["H"= new Science_Chemistry_Element("H""Hydrogen",
  82.             1,1.0079"-255.34""-252.87""");
  83.         $periodic_table["He"= new Science_Chemistry_Element("He""Helium",
  84.             2,4.00260"< -272.2""-268.934""Noble gas");
  85.         $periodic_table["Li"= new Science_Chemistry_Element("Li""Lithium",
  86.             3,6.941"180.54""1342""Alkaline");
  87.         $periodic_table["Be"= new Science_Chemistry_Element("Be""Beryllium",
  88.             4,9.01218"1278""2970""Alkaline Earth");
  89.         $periodic_table["B"= new Science_Chemistry_Element("B""Boron",
  90.             5,10.81"2079""2550""");
  91.         $periodic_table["C"= new Science_Chemistry_Element("C""Carbon",
  92.             6,12.011"3550""4827""");
  93.         $periodic_table["N"= new Science_Chemistry_Element("N""Nitrogen",
  94.             7,14.0067"-209.86""-195.8""");
  95.         $periodic_table["O"= new Science_Chemistry_Element("O""Oxygen",
  96.             8,15.9994"-218.4""-182.962""");
  97.         $periodic_table["F"= new Science_Chemistry_Element("F""Fluorine",
  98.             9,18.9984"-219.62""-188""Halogen");
  99.         $periodic_table["Ne"= new Science_Chemistry_Element("Ne""Neon",
  100.             10,20.179"-248.67""-246.048""Noble gas");
  101.         $periodic_table["Na"= new Science_Chemistry_Element("Na""Sodium",
  102.             11,22.9898"97.81""882.9""Alkaline");
  103.         $periodic_table["Mg"= new Science_Chemistry_Element("Mg""Magnesium",
  104.             12,24.305"648.8""1090""Alkaline Earth");
  105.         $periodic_table["Al"= new Science_Chemistry_Element("Al""Aluminum",
  106.             13,26.9815"660.37""2467""");
  107.         $periodic_table["Si"= new Science_Chemistry_Element("Si""Silicon",
  108.             14,28.0855"1410""2355""");
  109.         $periodic_table["P"= new Science_Chemistry_Element("P""Phosphorus",
  110.             15,30.9738"44.1""280""");
  111.         $periodic_table["S"= new Science_Chemistry_Element("S""Sulfur",
  112.             16,32.06"112.8 (rhombic); 119.0 (monoclinic)""4.6""");
  113.         $periodic_table["Cl"= new Science_Chemistry_Element("Cl""Chlorine",
  114.             17,35.453"-100.98""-34""Halogen");
  115.         $periodic_table["Ar"= new Science_Chemistry_Element("Ar""Argon",
  116.             18,39.948"-189.2""-185.7""Noble gas");
  117.         $periodic_table["K"= new Science_Chemistry_Element("K""Potassium",
  118.             19,39.0983"63.25""759.9""Alkaline");
  119.         $periodic_table["Ca"= new Science_Chemistry_Element("Ca""Calcium",
  120.             20,40.078"839""1484""Alkaline Earth");
  121.         $periodic_table["Sc"= new Science_Chemistry_Element("Sc""Scandium",
  122.             21,44.9579"1541""2836""Transition Metal");
  123.         $periodic_table["Ti"= new Science_Chemistry_Element("Ti""Titanium",
  124.             22,47.88"1660""3287""Transition Metal");
  125.         $periodic_table["V"= new Science_Chemistry_Element("V""Vanadium",
  126.             23,50.9415"1890""3380""Transition Metal");
  127.         $periodic_table["Cr"= new Science_Chemistry_Element("Cr""Chromium",
  128.             24,51.996"1857""2672""Transition Metal");
  129.         $periodic_table["Mn"= new Science_Chemistry_Element("Mn""Manganese",
  130.             25,54.9380"1244""1962""Transition Metal");
  131.         $periodic_table["Fe"= new Science_Chemistry_Element("Fe""Iron",
  132.             26,55.847"1535""2750""Transition Metal");
  133.         $periodic_table["Co"= new Science_Chemistry_Element("Co""Cobalt",
  134.             27,58.9332"1857""2672""Transition Metal");
  135.         $periodic_table["Ni"= new Science_Chemistry_Element("Ni""Nickel",
  136.             28,58.69"1453""2732""Transition Metal");
  137.         $periodic_table["Cu"= new Science_Chemistry_Element("Cu""Copper",
  138.             29,63.546"1083""2567""Transition Metal");
  139.         $periodic_table["Zn"= new Science_Chemistry_Element("Zn""Zinc",
  140.             30,65.38"419.58""907""Transition Metal");
  141.         $periodic_table["Ga"= new Science_Chemistry_Element("Ga""Gallium",
  142.             31,69.72"29.78""2403""");
  143.         $periodic_table["Ge"= new Science_Chemistry_Element("Ge""Germanium",
  144.             32,72.59"937.4""2830""");
  145.         $periodic_table["As"= new Science_Chemistry_Element("As""Arsenic",
  146.             33,74.9216"817""613""");
  147.         $periodic_table["Se"= new Science_Chemistry_Element("Se""Selenium",
  148.             34,78.96"50 (amorphous); 217 (gray form)""685""");
  149.         $periodic_table["Br"= new Science_Chemistry_Element("Br""Bromine",
  150.             35,79.904"-7.2""58.78""Halogen");
  151.         $periodic_table["Kr"= new Science_Chemistry_Element("Kr""Krypton",
  152.             36,83.80"-156.6""-152.30""Noble gas");
  153.         $periodic_table["Rb"= new Science_Chemistry_Element("Rb""Rubidium",
  154.             37,85.4678"38.89""686""Alkaline");
  155.         $periodic_table["Sr"= new Science_Chemistry_Element("Sr""Strontium",
  156.             38,87.62"769""1384""Alkaline Earth");
  157.         $periodic_table["Y"= new Science_Chemistry_Element("Y""Yttrium",
  158.             39,88.9059"1522""5338""Transition Metal");
  159.         $periodic_table["Zr"= new Science_Chemistry_Element("Zr""Zirconium",
  160.             40,91.22"1852""4377""Transition Metal");
  161.         $periodic_table["Nb"= new Science_Chemistry_Element("Nb""Niobium",
  162.             41,92.9064"2468""4742""Transition Metal");
  163.         $periodic_table["Mo"= new Science_Chemistry_Element("Mo""Molybdenum",
  164.             42,95.94"2617""4612""Transition Metal");
  165.         $periodic_table["Tc"= new Science_Chemistry_Element("Tc""Technetium",
  166.             43,97.9072"2172""4877""Transition Metal");
  167.         $periodic_table["Ru"= new Science_Chemistry_Element("Ru""Ruthenium",
  168.             44,101.07"2310""3900""Transition Metal");
  169.         $periodic_table["Rh"= new Science_Chemistry_Element("Rh""Rhodium",
  170.             45,102.9055"1966""3727""Transition Metal");
  171.         $periodic_table["Pd"= new Science_Chemistry_Element("Pd""Palladium",
  172.             46,106.42"1554""3140""Transition Metal");
  173.         $periodic_table["Ag"= new Science_Chemistry_Element("Ag""Silver",
  174.             47,107.8682"961.93""2212""Transition Metal");
  175.         $periodic_table["Cd"= new Science_Chemistry_Element("Cd""Cadmium",
  176.             48,112.41"320.9""765""Transition Metal");
  177.         $periodic_table["In"= new Science_Chemistry_Element("In""Indium",
  178.             49,114.82"156.61""2080""");
  179.         $periodic_table["Sn"= new Science_Chemistry_Element("Sn""Tin",
  180.             50,118.69"231.97""2270""");
  181.         $periodic_table["Sb"= new Science_Chemistry_Element("Sb""Antimony",
  182.             51,121.79"630.74""1750""");
  183.         $periodic_table["Te"= new Science_Chemistry_Element("Te""Tellurium",
  184.             52,127.60"449.5""4877""");
  185.         $periodic_table["I"= new Science_Chemistry_Element("I""Iodine",
  186.             53,126.9045"113.5""184.35""Halogen");
  187.         $periodic_table["Xe"= new Science_Chemistry_Element("Xe""Xenon",
  188.             54,131.29"-111.9""-107.1""Noble gas");
  189.         $periodic_table["Cs"= new Science_Chemistry_Element("Cs""Cesium",
  190.             55,132.9054"28.40""669.3""Alkaline");
  191.         $periodic_table["Ba"= new Science_Chemistry_Element("Ba""Barium",
  192.             56,137.33"725""1640""Alkaline Earth");
  193.         $periodic_table["La"= new Science_Chemistry_Element("La""Lanthanum",
  194.             57,138.9055"918""3464""Lanthanide");
  195.         $periodic_table["Ce"= new Science_Chemistry_Element("Ce""Cerium",
  196.             58,140.12"798""3443""Lanthanide");
  197.         $periodic_table["Pr"= new Science_Chemistry_Element("Pr""Praseodymium",
  198.             59,140.9077"931""3520""Lanthanide");
  199.         $periodic_table["Nd"= new Science_Chemistry_Element("Nd""Neodymium",
  200.             60,144.24"1021""3074""Lanthanide");
  201.         $periodic_table["Pm"= new Science_Chemistry_Element("Pm""Promethium",
  202.             61,144.9127"1042""3000""Lanthanide");
  203.         $periodic_table["Sm"= new Science_Chemistry_Element("Sm""Samarium",
  204.             62,150.36"1074""1794""Lanthanide");
  205.         $periodic_table["Eu"= new Science_Chemistry_Element("Eu""Europium",
  206.             63,151.96"822""1527""Lanthanide");
  207.         $periodic_table["Gd"= new Science_Chemistry_Element("Gd""Gadolinium",
  208.             64,157.27"1313""3273""Lanthanide");
  209.         $periodic_table["Tb"= new Science_Chemistry_Element("Tb""Terbium",
  210.             65,158.9254"1356""3230""Lanthanide");
  211.         $periodic_table["Dy"= new Science_Chemistry_Element("Dy""Dysprosium",
  212.             66,162.50"1412""2567""Lanthanide");
  213.         $periodic_table["Ho"= new Science_Chemistry_Element("Ho""Holmium",
  214.             67,164.9304"1474""2700""Lanthanide");
  215.         $periodic_table["Er"= new Science_Chemistry_Element("Er""Erbium",
  216.             68,167.26"1529""2868""Lanthanide");
  217.         $periodic_table["Tm"= new Science_Chemistry_Element("Tm""Thulium",
  218.             69,168.9342"1545""1950""Lanthanide");
  219.         $periodic_table["Yb"= new Science_Chemistry_Element("Yb""Ytterbium",
  220.             70,172.04"819""1196""Lanthanide");
  221.         $periodic_table["Lu"= new Science_Chemistry_Element("Lu""Lutetium",
  222.             71,174.967"1663""3402""Lanthanide");
  223.         $periodic_table["Hf"= new Science_Chemistry_Element("Hf""Hafnium",
  224.             72,178.49"2227""4602""Transition Metal");
  225.         $periodic_table["Ta"= new Science_Chemistry_Element("Ta""Tantalum",
  226.             73,180.9479"2996""5425""Transition Metal");
  227.         $periodic_table["W"= new Science_Chemistry_Element("W""Tungsten",
  228.             74,183.85"3410""5660""Transition Metal");
  229.         $periodic_table["Re"= new Science_Chemistry_Element("Re""Rhenium",
  230.             75,186.207"3180""5627""Transition Metal");
  231.         $periodic_table["Os"= new Science_Chemistry_Element("Os""Osmium",
  232.             76,190.2"3054""5027""Transition Metal");
  233.         $periodic_table["Ir"= new Science_Chemistry_Element("Ir""Iridium",
  234.             77,192.22"2410""4130""Transition Metal");
  235.         $periodic_table["Pt"= new Science_Chemistry_Element("Pt""Platinum",
  236.             78,195.08"1772""3827""Transition Metal");
  237.         $periodic_table["Au"= new Science_Chemistry_Element("Au""Gold",
  238.             79,196.9665"1064.4""2808""Transition Metal");
  239.         $periodic_table["Hg"= new Science_Chemistry_Element("Hg""Mercury",
  240.             80,200.59"-38.87""356.58""Transition Metal");
  241.         $periodic_table["Tl"= new Science_Chemistry_Element("Tl""Thallium",
  242.             81,204.383"303.5""1457""");
  243.         $periodic_table["Pb"= new Science_Chemistry_Element("Pb""Lead",
  244.             82,207.2"327.502""1740""");
  245.         $periodic_table["Bi"= new Science_Chemistry_Element("Bi""Bismuth",
  246.             83,208.9804"271.3""1560""");
  247.         $periodic_table["Po"= new Science_Chemistry_Element("Po""Polonium",
  248.             84,208.9824"254""962""");
  249.         $periodic_table["At"= new Science_Chemistry_Element("At""Astatine",
  250.             85,209.9871"302""337""Halogen");
  251.         $periodic_table["Rn"= new Science_Chemistry_Element("Rn""Radon",
  252.             86,222.0176"-71""-62""Noble gas");
  253.         $periodic_table["Fr"= new Science_Chemistry_Element("Fr""Francium",
  254.             87,223.0197"27""677""Alkaline");
  255.         $periodic_table["Ra"= new Science_Chemistry_Element("Ra""Radium",
  256.             88,226.0254"700""1140""Alkaline Earth");
  257.         $periodic_table["Ac"= new Science_Chemistry_Element("Ac""Actinium",
  258.             89,227.0278"1050""3200""Actinide");
  259.         $periodic_table["Th"= new Science_Chemistry_Element("Th""Thorium",
  260.             90,232.0381"1750""3800""Actinide");
  261.         $periodic_table["Pa"= new Science_Chemistry_Element("Pa""Protactinium",
  262.             91,231.0359"1600""unknown""Actinide");
  263.         $periodic_table["U"= new Science_Chemistry_Element("U""Uranium",
  264.             92,238.0289"1132""3818""Actinide");
  265.         $periodic_table["Np"= new Science_Chemistry_Element("Np""Neptunium",
  266.             93,237.0482"640""3902""Actinide");
  267.         $periodic_table["Pu"= new Science_Chemistry_Element("Pu""Plutonium",
  268.             94,244.0642"641""3232""Actinide");
  269.         $periodic_table["Am"= new Science_Chemistry_Element("Am""Americium",
  270.             95,243.0614"994""2607""Actinide");
  271.         $periodic_table["Cm"= new Science_Chemistry_Element("Cm""Curium",
  272.             96,247.0703"1340""unknown""Actinide");
  273.         $periodic_table["Bk"= new Science_Chemistry_Element("Bk""Berkelium",
  274.             97,247.0703"unknown""unknown""Actinide");
  275.         $periodic_table["Cf"= new Science_Chemistry_Element("Cf""Californium",
  276.             98,251.0796"unknown""unknown""Actinide");
  277.         $periodic_table["Es"= new Science_Chemistry_Element("Es""Einsteinium",
  278.             99,252.083"unknown""unknown""Actinide");
  279.         $periodic_table["Fm"= new Science_Chemistry_Element("Fm""Fermium",
  280.             100,257.0951"unknown""unknown""Actinide");
  281.         $periodic_table["Md"= new Science_Chemistry_Element("Md""Mendelevium",
  282.             101,258.10"unknown""unknown""Actinide");
  283.         $periodic_table["No"= new Science_Chemistry_Element("No""Nobelium",
  284.             102,259.1009"unknown""unknown""Actinide");
  285.         $periodic_table["Lr"= new Science_Chemistry_Element("Lr""Lawrencium",
  286.             103,262.11"unknown""unknown""Actinide");
  287.         $periodic_table["Unq (Rf)"= new Science_Chemistry_Element("Unq (Rf)""Unnilquadium (Rutherfordium)",
  288.             104,261.11"unknown""unknown""");
  289.         $periodic_table["Unp (Db)"= new Science_Chemistry_Element("Unp (Db)""Unnilpentium (Dubnium)",
  290.             105,262.114"unknown""unknown""");
  291.         $periodic_table["Unh (Sg)"= new Science_Chemistry_Element("Unh (Sg)""Unnilhexium (Seaborgium)",
  292.             106,263.118"unknown""unknown""");
  293.         $periodic_table["Uns (Bh)"= new Science_Chemistry_Element("Uns (Bh)""Unnilseptium (Bohrium)",
  294.             107,262.12"unknown""unknown""");
  295.         $periodic_table["Uno (Hs)"= new Science_Chemistry_Element("Uno (Hs)""Unniloctium (Hassium)",
  296.             108,-1"unknown""unknown""");
  297.         $periodic_table["Une (Mt)"= new Science_Chemistry_Element("Une (Mt)""Unnilennium (Meitnerium)",
  298.             109,-1"unknown""unknown""");
  299.     }
  300.     
  301. // end of Science_Chemistry_Periodic_Table
  302.  
  303. // vim: expandtab: ts=4: sw=4
  304. ?>

Documentation generated on Mon, 11 Mar 2019 15:48:16 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.