# Periodic Table # By: Karen Ranger # This maplet is designed to easily display properties from the elements of the Periodic Table. In addition to displaying the properties in the maplet, you can also return these values to the Maple worksheet. To do this, select the Return Item button after displaying the property of the element you are interested in. # # To activate this maplet, simply execute the worksheet by selecting !!! in the toolbar above. with(Maplets[Elements]): ## To retrieve the element name, this simple procedure was created to capture the caption name ## of the button selected. RetrieveElement := proc(number) global elementreturned; if number = B152 then elementreturned:= I; else elementreturned:=Maplets:-Tools:-Get('number(caption)'::symbol); end if; end proc: ## Since Li, Si and Re are predefined in Maple, the following procedures are required to assign ## elementreturned to capture the properties of three elements. SetLi:=proc() global elementreturned; elementreturned:=Li; end proc: SetSi:=proc() global elementreturned; elementreturned:=Si; end proc: SetRe:=proc() global elementreturned; elementreturned:=Re; end proc: ## Display the atomic number of the element selected. AtomicNumber := proc() global elementreturned; ScientificConstants[GetElement](elementreturned); number=%[1]; end proc: ## Display the symbol of the element selected. Symbol := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, symbol); %[2]; end proc: ## To retrieve the element name, this simple procedure was created to capture the caption name ## of the button selected. RetrieveElement := proc(number) global elementreturned; if number = B152 then elementreturned:= I; else elementreturned:=Maplets:-Tools:-Get('number(caption)'::symbol); end if; end proc: ## Since Li, Si and Re are predefined in Maple, the following procedures are required to assign ## elementreturned to capture the properties of three elements. SetLi:=proc() global elementreturned; elementreturned:=Li; end proc: SetSi:=proc() global elementreturned; elementreturned:=Si; end proc: SetRe:=proc() global elementreturned; elementreturned:=Re; end proc: ## Display the atomic number of the element selected. AtomicNumber := proc() global elementreturned; ScientificConstants[GetElement](elementreturned); number=%[1]; end proc: ## Display the symbol of the element selected. Symbol := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, symbol); %[2]; end proc: ElementName := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, name); %[2]; end proc: ## Display the melting point of the element selected. MeltingPoint := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, meltingpoint); %[2]; end proc: ## Display the atomic weight of the element selected. AtomicWeight := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, atomicweight); %[2]; end proc: ## Display the ionization energy of the element selected. IonizationEnergy := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, ionizationenergy); %[2]; end proc: ## Display the boiling point of the element selected. BoilingPoint := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, boilingpoint); %[2]; end proc: ## Display the electronegativity of the element selected. ElectroNegativity := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, electronegativity); %[2]; end proc: ## Display the electron affinity of the element selected. ElectronAffinity := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, electronaffinity); %[2]; end proc: ## Display the density of the element selected. Density := proc() global elementreturned; ScientificConstants[GetElement](elementreturned, density); %[2]; end proc: ##################### The design layout of the Periodic Table ########################## ##### and the design layout of an additional window displaying element properties ###### maplet:= Maplet(onstartup=RunWindow(Main), Window[Main]("Periodic Table", height='250', width='1000', GridLayout(inset=0, [ [Button['B100'](" H ", background=coral, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B100)"), RunWindow(ElementInformation))), GridCell(width=17, Button['B101'](" He", background=wheat, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B101)"), RunWindow(ElementInformation))), left) ], [Button['B102'](" Li", background=coral, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="SetLi"), RunWindow(ElementInformation))), Button['B103'](" Be", background=magenta, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B103)"), RunWindow(ElementInformation))), GridCell(width=11, Button['B104'](" B ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B104)"), RunWindow(ElementInformation))),left), Button['B105'](" C ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B105)"), RunWindow(ElementInformation))), Button['B106'](" N ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B106)"), RunWindow(ElementInformation))), Button['B107'](" O ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B107)"), RunWindow(ElementInformation))), Button['B108'](" F ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B108)"), RunWindow(ElementInformation))), Button['B109'](" Ne", background=wheat, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B109)"), RunWindow(ElementInformation))) ], [Button['B110'](" Na", background=coral, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B110)"), RunWindow(ElementInformation))), Button['B111'](" Mg",background=magenta,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B111)"), RunWindow(ElementInformation))), GridCell(width=11, Button['B112'](" Al", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B112)"), RunWindow(ElementInformation))),left), Button['B113'](" Si", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="SetSi"), RunWindow(ElementInformation))), Button['B114'](" P ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B114)"), RunWindow(ElementInformation))), Button['B115'](" S ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B115)"), RunWindow(ElementInformation))), Button['B116'](" Cl", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B116)"), RunWindow(ElementInformation))), Button['B117'](" Ar", background=wheat, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B117)"), RunWindow(ElementInformation))) ], [Button['B118'](" K ", background=coral, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B118)"), RunWindow(ElementInformation))), Button['B119'](" Ca",background=magenta,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B119)"), RunWindow(ElementInformation))), Button['B120'](" Sc", background=blue, 'font' = Font("Courier New", bold, 12),Action(Evaluate('function'="RetrieveElement(B120)"), RunWindow(ElementInformation))), Button['B121'](" Ti", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B121)"), RunWindow(ElementInformation))), Button['B122'](" V ", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B122)"), RunWindow(ElementInformation))), Button['B123'](" Cr", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B123)"), RunWindow(ElementInformation))), Button['B124'](" Mn", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B124)"), RunWindow(ElementInformation))), Button['B125'](" Fe", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B125)"), RunWindow(ElementInformation))), Button['B126'](" Co", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B126)"), RunWindow(ElementInformation))), Button['B127'](" Ni", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B127)"), RunWindow(ElementInformation))), Button['B128'](" Cu", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B128)"), RunWindow(ElementInformation))), Button['B129'](" Zn", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B129)"), RunWindow(ElementInformation))), Button['B130'](" Ga", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B130)"), RunWindow(ElementInformation))), Button['B131'](" Ge", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B131)"), RunWindow(ElementInformation))), Button['B132'](" As", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B132)"), RunWindow(ElementInformation))), Button['B133'](" Se", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B133)"), RunWindow(ElementInformation))), Button['B134'](" Br", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B134)"), RunWindow(ElementInformation))), Button['B135'](" Kr", background=wheat, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B135)"), RunWindow(ElementInformation))) ], [Button['B136'](" Rb", background=coral, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B136)"), RunWindow(ElementInformation))), Button['B137'](" Sr",background=magenta,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B137)"), RunWindow(ElementInformation))), Button['B138'](" Y ", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B138)"), RunWindow(ElementInformation))), Button['B139'](" Zr", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B139)"), RunWindow(ElementInformation))), Button['B140'](" Nb", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B140)"), RunWindow(ElementInformation))), Button['B141'](" Mo", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B141)"), RunWindow(ElementInformation))), Button['B142'](" Tc", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B142)"), RunWindow(ElementInformation))), Button['B143'](" Ru", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B143)"), RunWindow(ElementInformation))), Button['B144'](" Rh", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B144)"), RunWindow(ElementInformation))), Button['B145'](" Pd", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B145)"), RunWindow(ElementInformation))), Button['B146'](" Ag", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B146)"), RunWindow(ElementInformation))), Button['B147'](" Cd", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B147)"), RunWindow(ElementInformation))), Button['B148'](" In", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B148)"), RunWindow(ElementInformation))), Button['B149'](" Sn", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B149)"), RunWindow(ElementInformation))), Button['B150'](" Sb", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B150)"), RunWindow(ElementInformation))), Button['B151'](" Te", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B151)"), RunWindow(ElementInformation))), Button['B152'](" I ", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B152)"), RunWindow(ElementInformation))), Button['B153'](" Xe", background=wheat, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B153)"), RunWindow(ElementInformation))) ], [Button['B154'](" Cs", background=coral, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B154)"), RunWindow(ElementInformation))), Button['B155'](" Ba",background=magenta,'font' = Font("Courier New", bold, 12),Action(Evaluate('function'="RetrieveElement(B155)"), RunWindow(ElementInformation))), GridCell(width=2, Button['B156'](" ", visible='false',background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B156)"), RunWindow(ElementInformation))), left), Button['B157'](" Hf", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B157)"), RunWindow(ElementInformation))), Button['B158'](" Ta", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B158)"), RunWindow(ElementInformation))), Button['B159'](" W ", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B159)"), RunWindow(ElementInformation))), Button['B160'](" Re", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="SetRe"), RunWindow(ElementInformation))), Button['B161'](" Os", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B161)"), RunWindow(ElementInformation))), Button['B162'](" Ir", background=blue,'font' = Font("Courier New", bold, 12),Action(Evaluate('function'="RetrieveElement(B162)"), RunWindow(ElementInformation))), Button['B163'](" Pt", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B163)"), RunWindow(ElementInformation))), Button['B164'](" Au", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B164)"), RunWindow(ElementInformation))), Button['B165'](" Hg", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B165)"), RunWindow(ElementInformation))), Button['B166'](" Tl", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B166)"), RunWindow(ElementInformation))), Button['B167'](" Pb", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B167)"), RunWindow(ElementInformation))), Button['B168'](" Bi", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B168)"), RunWindow(ElementInformation))), Button['B169'](" Po", background=plum, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B169)"), RunWindow(ElementInformation))), Button['B170'](" At", background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B170)"), RunWindow(ElementInformation))), Button['B171'](" Rn", background=wheat, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B171)"), RunWindow(ElementInformation))) ], [Button['B172'](" Fr", background=coral, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B172)"), RunWindow(ElementInformation))), Button['B173'](" Ra",background=magenta,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B173)"), RunWindow(ElementInformation))), GridCell(width=2, Button['B174']("La", visible='false',background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B174)"), RunWindow(ElementInformation))), left), Button['B175'](" Rf", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B175)"), RunWindow(ElementInformation))), Button['B176'](" Db", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B176)"), RunWindow(ElementInformation))), Button['B177'](" Sg", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B177)"), RunWindow(ElementInformation))), Button['B178'](" Bh", background=blue,'font' = Font("Courier New", bold, 12),Action(Evaluate('function'="RetrieveElement(B178)"), RunWindow(ElementInformation))), Button['B179'](" Hs", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B179)"), RunWindow(ElementInformation))), Button['B180'](" Mt", background=blue,'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B180)"), RunWindow(ElementInformation))), Button['B181']("Uun", background=turquoise, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B181)"), RunWindow(ElementInformation))), Button['B182']("Uuu", background=turquoise, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B182)"), RunWindow(ElementInformation))), Button['B183']("Uub", background=turquoise, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B183)"), RunWindow(ElementInformation))), GridCell(width=2, Button['B184']("La", visible='false',background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B184)"), RunWindow(ElementInformation))), left), Button['B185']("Uuq", background=turquoise, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B185)"), RunWindow(ElementInformation))), GridCell(width=2, Button['B186']("La", visible='false',background=aquamarine, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B186)"), RunWindow(ElementInformation))), left), Button['B187']("Uun", background=turquoise, 'font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B187)"), RunWindow(ElementInformation))), GridCell(width=2, Button['B188']("", visible='false','font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B188)"), RunWindow(ElementInformation))), left), GridCell(width=2, Button['B189']("", visible='false','font' = Font("Courier New", bold, 12), Action(Evaluate('function'="RetrieveElement(B189)"), RunWindow(ElementInformation))), left) ] ] ) ), #######################################END OF MAIN WINDOW################################### #####################################ELEMENT WINDOWS######################################## Window[ElementInformation]("Element Information", GridLayout('border'='true', inset=0, [[TextBox['ML'](3..75, editable='true') ], [GridCell(Button['B200'](" Atomic Number ", Evaluate('target'='ML', 'function' = "AtomicNumber"))), GridCell(Button['B201'](" Symbol ", Evaluate('target'='ML', 'function' = "Symbol"))), GridCell(Button['B202'](" Element Name ", Evaluate('target'='ML', 'function' = "ElementName"))), GridCell(Button['B203'](" Boiling Point ", Evaluate('target'='ML', 'function' = "BoilingPoint"))), GridCell(Button['B204'](" Melting Point ", Evaluate('target'='ML', 'function' = "MeltingPoint")))], [GridCell(Button['B205']("Electronegativity",Evaluate('target'='ML','function' = "ElectroNegativity"))), GridCell(Button['B206']("Electron Affinity", Evaluate('target' = 'ML', 'function' = "ElectronAffinity"))), GridCell(Button['B207']("Ionization Energy",Evaluate('target'='ML','function' = "IonizationEnergy"))), GridCell(Button['B208']("Atomic Weight ", Evaluate('target' = 'ML', 'function' = "AtomicWeight"))), GridCell(Button['B209'](" Density ", Evaluate('target' = 'ML', 'function' = "Density")))], [GridCell(Button['B210']("Close", Action(CloseWindow('ElementInformation'), SetOption('target' = 'ML', 'value' = "")))), GridCell(Button['B211']("Return item", Shutdown(['ML']))) ] ])) ): Maplets[Display](maplet);