Chemical equation balancer

Related tags

Miscellaneous chemeq
Overview

Chemical equation balancer

Balance your chemical equations with ease!

Installation

$ git clone [email protected]:InCogNiTo124/chemeq.git && cd chemeq;
$ python3 -m venv venv
$ source venv/bin/activate
$ (venv) pip install -r requirements/main.txt

Optionally, install dev dependencies inside the virtual environment and check the code:

$ (venv) pip install -r requirements/dev.txt
$ (venv) make check

Usage

python3 main.py -i ${INPUT_CHEM_1} ${INPUT_CHEM_2} ... -o ${OUTPUT_CHEM_1} ${OUTPUT_CHEM_2} ...

Note, there must be at least one input and at least one output.

Examples:

$ (venv) python3 main.py -i CH4 Cl2 -o CH3Cl H2
2CH4 + Cl2 --> 2CH3Cl + H2
$ (venv) python3 main.py -i 'KOH' 'Co3(PO4)2' -o 'K3PO4' 'Co(OH)2'
6KOH + Co3(PO4)2 --> 2K3PO4 + 3Co(OH)2
$ (venv) python3 main.py -i CH3CH2OH O2 -o CO2 H2O
CH3CH2OH + 3O2 --> 2CO2 + 3H2O

How it works?

The idea is to write every molecule as a vector, such that the first dimension corresponds to one atom, the second for another etc. Then, both the left side and the right side can be though of as linear combination of vectors. After a short matrix calculation, it can be shown that the solution which balances the chemical equation is actually a basis vector in the nullspace of the system matrix.

For more details, try to figure out https://en.wikipedia.org/wiki/Chemical_equation#Balancing_chemical_equations

I've actually come up with the idea on my own.

TODO:

  • Web deployment
  • Simpler implementation?
  • More docs? idk
  • Bugfixes? idk
You might also like...
Python-based Informatics Kit for Analysing Chemical Units

INSTALLATION Python-based Informatics Kit for the Analysis of Chemical Units Step 1: Make a conda environment: conda create -n pikachu python=3.9 cond

AnuGA for the simulation of the shallow water equation

ANUGA Contents ANUGA What is ANUGA? Installation Documentation and Help Mailing Lists Web sites Latest source code Bug reports Developer information L

2D Time independent Schrodinger equation solver for arbitrary shape of well
2D Time independent Schrodinger equation solver for arbitrary shape of well

Schrodinger Well Python Python solver for timeless Schrodinger equation for well with arbitrary shape https://imgur.com/a/jlhK7OZ Pictures of circular

monolish: MONOlithic Liner equation Solvers for Highly-parallel architecture

monolish is a linear equation solver library that monolithically fuses variable data type, matrix structures, matrix data format, vendor specific data transfer APIs, and vendor specific numerical algebra libraries.

A module for solving and visualizing Schrödinger equation.
A module for solving and visualizing Schrödinger equation.

qmsolve This is an attempt at making a solid, easy to use solver, capable of solving and visualize the Schrödinger equation for multiple particles, an

An application that maps an image of a LaTeX math equation to LaTeX code.
An application that maps an image of a LaTeX math equation to LaTeX code.

Convert images of LaTex math equations into LaTex code.

A linear equation solver using gaussian elimination. Implemented for fun and learning/teaching.

A linear equation solver using gaussian elimination. Implemented for fun and learning/teaching. The solver will solve equations of the type: A can be

Flood modeling by 2D shallow water equation
Flood modeling by 2D shallow water equation

hydraulicmodel Flood modeling by 2D shallow water equation. Refer to Hunter et al (2005), Bates et al. (2010). Diffusive wave approximation Local iner

The venturimeter works on the principle of Bernoulli's equation, i.e., the pressure decreases as the velocity increases.

The venturimeter works on the principle of Bernoulli's equation, i.e., the pressure decreases as the velocity increases. The cross-section of the throat is less than the cross-section of the inlet pipe.The animation is done in python manim

This app is to use algorithms to find the root of the equation

In this repository, I made an amazing app with tkinter python language and other libraries the idea of this app is to use algorithms to find the root of the equation I used three methods from numerical analysis method that find the root and I made property draw function that draws almost any equation

A python package simulating the quasi-2D pseudospin-1/2 Gross-Pitaevskii equation with NVIDIA GPU acceleration.
A python package simulating the quasi-2D pseudospin-1/2 Gross-Pitaevskii equation with NVIDIA GPU acceleration.

A python package simulating the quasi-2D pseudospin-1/2 Gross-Pitaevskii equation with NVIDIA GPU acceleration. Introduction spinor-gpe is high-level,

Finite difference solution of 2D Poisson equation. Can handle Dirichlet, Neumann and mixed boundary conditions.
Finite difference solution of 2D Poisson equation. Can handle Dirichlet, Neumann and mixed boundary conditions.

Poisson-solver-2D Finite difference solution of 2D Poisson equation Current version can handle Dirichlet, Neumann, and mixed (combination of Dirichlet

Cweqgen - The CW Equation Generator

The CW Equation Generator The cweqgen (pronouced like "Queck-Jen") package provi

PINN Burgers - 1D Burgers equation simulated by PINN

PINN(s): Physics-Informed Neural Network(s) for Burgers equation This is an impl

Owner
Marijan Smetko
Student at Faculty of Electrical Engineering and Computing, Zagreb
Marijan Smetko
This app is to use algorithms to find the root of the equation

In this repository, I made an amazing app with tkinter python language and other libraries the idea of this app is to use algorithms to find the root of the equation I used three methods from numerical analysis method that find the root and I made property draw function that draws almost any equation

Mohammad Al Jadallah 3 Sep 16, 2022
Chemical equation balancer

Chemical equation balancer Balance your chemical equations with ease! Installation $ git clone [email protected]:InCogNiTo124/chemeq.git && cd chemeq; $

Marijan Smetko 4 Nov 26, 2022
Optimising chemical reactions using machine learning

Summit Summit is a set of tools for optimising chemical processes. We’ve started by targeting reactions. What is Summit? Currently, reaction optimisat

Sustainable Reaction Engineering Group 75 Dec 14, 2022
Pipeline for chemical image-to-text competition

BMS-Molecular-Translation Introduction This is a pipeline for Bristol-Myers Squibb – Molecular Translation by Vadim Timakin and Maksim Zhdanov. We got

Maksim Zhdanov 7 Sep 20, 2022
A central task in drug discovery is searching, screening, and organizing large chemical databases

A central task in drug discovery is searching, screening, and organizing large chemical databases. Here, we implement clustering on molecular similarity. We support multiple methods to provide a interactive exploration of chemical space.

NVIDIA Corporation 124 Jan 7, 2023
Programmatically access the physical and chemical properties of elements in modern periodic table.

API to fetch elements of the periodic table in JSON format. Uses Pandas for dumping .csv data to .json and Flask for API Integration. Deployed on "pyt

the techno hack 3 Oct 23, 2022
Systemic Evolutionary Chemical Space Exploration for Drug Discovery

SECSE SECSE: Systemic Evolutionary Chemical Space Explorer Chemical space exploration is a major task of the hit-finding process during the pursuit of

null 64 Dec 16, 2022
Interactive chemical viewer for 2D structures of small molecules

?? mols2grid mols2grid is an interactive chemical viewer for 2D structures of small molecules, based on RDKit. ➡️ Try the demo notebook on Google Cola

Cédric Bouysset 154 Dec 26, 2022
Chemical Analysis Calculator, with full solution display.

Chemicology Chemical Analysis Calculator, to solve problems efficiently by displaying whole solution. Go to releases for downloading .exe, .dmg, Linux

Muhammad Moazzam 2 Aug 6, 2022
Chemical Structure Generator

CSG: Chemical Structure Generator A simple Chemical Structure Generator. Requirements Python 3 (>= v3.8) PyQt5 (optional; >= v5.15.0 required for grap

JP&K 5 Oct 22, 2022