Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.55 KB

File metadata and controls

36 lines (27 loc) · 1.55 KB

Author: Fernando Henrique da Costa fernando.henriquecosta@yahoo.com.br

DESCRIPTION

A quick and simple way to convert chemical compositions of alloys with any number of elements. This Python code runs on the command line or terminal. You just need to download the file 'Conversion from atomic to weight.py'. You need to have Python installed on your computer. The options are selected interactively as they are displayed on the screen.

There are four possible conversion options:

  • Convert from atomic fraction to atomic percent;
  • Convert from atomic fraction to weight percent;
  • Convert from atomic percent to weight percent;
  • Convert from weight percent to atomic percent.

How to enter the data:

  1. The elements should be written according to their periodic table symbols using upper and lower case.
  2. If the sum of the composition is not totaling 100% for percentage cases, a warning will be given (however, the calculation will be carried out anyway).
  3. The compositions should be written as follows: element followed by its amount

For atomic fractions, when no number is placed, it will be considered as 1. This facilitates the insertion of compositions like this: AgCu.

Other examples include: Ti1Nb2 for an atomic fraction composition. Mg30W70 for an atomic or weight percent composition. There is no limit of elements, for example: Mg10Nb10W10Ti10Fe10Mo10Mn10Al10Si10Ta10.

Decimal places are accepted in any type of composition inserted.

Please let me know if you find any bugs.