There are hits, thank you. (since 1999-06-08)
Calculating formula weight and percent of elements must be the most elemental part in chemical education. However, there are few computer programs, especially running on unix system. Then I have made it.
This program calculate formula weight and percent of each elements for the given chemical formula.
This program was developed on the unix system (FreeBSD 2.2.8R + Motif 2.0), and was confermed to work on IRIX 6.5 system. Later, we changed the development machine to FreeBSD 3.2R + GTK+ 1.2.2. Though it is a X11 application with GUI, you will be able to use this program through command-line with argument of chemical formula.
IMPORTANT: Motif or GTK+ widget sets are required.
When you type, for Motif version,
% xmolwtor, for GTK+ version,
% gmolwtto run the program, calculator's window with GUI is appeared.
Figure: Molecular weight and elemental analysis calculator.
(Left) Motif version, (right) GTK+ version.
First, input the chemical formula which is constructed by the elemental symbols and numbers at the text field on the top of the window. The atomic group with braket, such as (H2O)2, is not recognized as that you wish. Please use H4O2 or H2OH2O, instead. White spaces are available to separate the elemental symbols.
You can use lower-case in such elemental symbols as h2o, if there are no ambiguity in the given chemical formula. In order to avoid that ambiguity, a white space can be used as a delimiter. (`si' means silicon, while `s i' is sulfur and iodine) In this case, push [Allow LowerCase] button.
After you input the chemical formula, push [Calculate] buttan. Then the formula weight and percent of each elements are printed out.
When you push [Clear] button, the input/output frames will be cleared.
Push [End] button, then the program ends.
X11 has the mechanism about GUI resources, which easily changes the look and feel of the programs.
When you use the Motif version, xmolwt, put an Xmolwt file on your home directry or add it to .Xdefaults/.Xresources.
While you use the GTK+ version, gmolwt, add a dot.gtkrc to .gtkrc on your home directry.
When you use this program at command-line, type as
% molwt <chemical formula>which is link to GUI version program, where <chemical formula> is a chemical formula itself, which contains elemental symbols and numbers of atoms. For example of ethanol, type
% molwt C2H5OHUse upper-case and lower-case to write elemental symbol correctly. You can use white space to separate the elemental symbol, where " or ' are needed by means of the unix shell argument.
% molwt "Cl C2 H4 OH"Then, the calculated results of formula weight and percent of each elements are printed out as follows:
Formula Weight = 46.069040 C 2 52.143479 % H 6 13.127341 % O 1 34.729180 %
Copyright (c), 1999, Ryo MIYAMOTO, All rights reserved.Re-distribution is permitted, if all source codes and documents are included in the packed archive. It is appreciated for me to send any bug-reports, effective patches, and modification ideas. Comments for this program are also welcome.
Please take the archive (tar + gzip) from HERE.
Ryo MIYAMOTO, Dr. Molecular Design Engineering, Department of Materials Science and Technology, Faculty of Science and Technology, Hirosaki University Bunkyo-cho 3, Hirosaki, 036-8561 JAPAN TEL 0172-39-3564 FAX 0172-39-3541 Email rmiya@cc.hirosaki-u.ac.jp