Skip to content

LauKr/Tellurium

Repository files navigation

made-with-python GitHub issues License: GPL v3 GitHub commits since tagged version GitHub repo size DOI

Tellurium

A molar mass calculation framework

A simple calculator for molar masses of compounds.

Getting Started

Prerequisites

The program requires Python 3.x

$ apt-get install python3.6

as well as numpy, pandas & PyQt5 (for GUI only)

$ pip install numpy pandas PyQt5

Setup

Get the .py file by either cloning, downloading or downloading as .zip and unzipping. Then use python for starting the MolarMassCalculator_console.py file.

For example:

$ python3 Molar-mass-calculator/MolarMassCalculator_console.py

Usage

Either use the GUI.py for a graphical interface or use MolarMassCalculator_console.py for a console input based version.

Basics

The program should ask for a structure name. This name can be inserted like La2O3. If the name cannot automatically converted into the necessary information which elements occure how often, the user will be asked to insert this information manually. The molar mass is is printed and the user will be asked if he/she wants to calculate the precursor masses necessary for the reaction. This information should be inserted like in the following example:

Reaction: H2 + 1/2 O2 -> H2O

Console only:

Input:

How many precursors do you use? 2

What is precursor No. 1 called? H2

How often is the precursor present? 1

What is precursor No. 1 called? O2

How often is the precursor present? 0.5

How much sample do you want to synthesize? [g] 1

Output:

You will need 0.1119 g of H2

You will need 0.8881 g of O2

Advanced

The program has a class molar_mass(), which takes the optinal argument . If is given this will be treated as the structre, if not the program will aks for it. You can use

sample123 = molar_mass("H2O")
print(sample123)

to get the information on the molar mass, or just

M = calculate("H2O")

to initialize M with the molar mass as a float.

To calculate the precursor masses, you'll need to call

sample123.precursor()

If you want to access the data on the molar masses, you can use

sample123.data
sample123.precursor_data
sample123.M

for the data on the compound respectively the precursors and the total molar mass of the compound.

Authors

  • Laurenz Kruty - Initial work - LauKr

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Acknowledgement

This project was created using not only Python, but also Qt.