Eulim

Last updated
Eulim
Original author(s) Syed Fazil Basheer
Developer(s) Syed Fazil Basheer, Somesh Choudhary
Initial releaseApril 11, 2017;5 years ago (2017-04-11)
Stable release
0.0.17 / July 15, 2017;5 years ago (2017-07-15) [1]
Repository github.com/ilm-labs/ilm
Written in Ruby
License MIT License

Eulim or ilm is a chemistry library written in Ruby under the MIT license. It supports the calculation of molecular mass of compound, balancing chemical equations, efficient handling of states of chemical species and many more things.

Contents

Example

$ irbirb(main):001:0> require'eulim'irb(main):002:0> Eulim::Chemistry::Reaction.new(equation:'KMnO4 + HCl >> KCl + MnCl2 + H2O + Cl2').balanced_eqn => "2KMnO4 + 16HCl >> 2KCl + 2MnCl2 + 8H2O + 5Cl2"irb(main):003:0> Eulim::Chemistry::Compound.new("CaCO3")=> #<Eulim::Chemistry::Compound:0x00000002a65340 @formula="CaCO3", @constituents={"Ca"=>{:element=>#<Eulim::Chemistry::Element:0x00000002c805a8 @name="Calcium", @symbol="Ca", @atomic_number=20, @atomic_mass=#<Unitwise::Measurement value=40.078 unit=u>>, :atom_count=>1}, "C"=>{:element=>#<Eulim::Chemistry::Element:0x00000002c8f6e8 @name="Carbon", @symbol="C", @atomic_number=6, @atomic_mass=#<Unitwise::Measurement value=12.0107 unit=u>>, :atom_count=>1}, "O"=>{:element=>#<Eulim::Chemistry::Element:0x00000002c8dc30 @name="Oxygen", @symbol="O", @atomic_number=8, @atomic_mass=#<Unitwise::Measurement value=15.9996 unit=u>>, :atom_count=>3}}, @molecular_mass=#<Unitwise::Measurement value=100.0875 unit=u>>irb(main):004:0> Eulim::Chemistry::Reaction.new(equation:'2Na(s) + 2HCl(aq) >> 2NaCl(aq) + H2(g)')=> #<Eulim::Chemistry::Reaction:0x00000002ce22f8 @equation="2Na(s) + 2HCl(aq) >> 2NaCl(aq) + H2(g)", @species={:reactants=>{"Na"=>{:compound=>#<Eulim::Chemistry::Compound:0x00000002ce1d80 @formula="Na", @constituents={"Na"=>{:element=>#<Eulim::Chemistry::Element:0x00000002c88e10 @name="Sodium", @symbol="Na", @atomic_number=11, @atomic_mass=#<Unitwise::Measurement value=22.9897 unit=u>>, :atom_count=>1}}, @molecular_mass=#<Unitwise::Measurement value=22.9897 unit=u>>, :stoichiometry=>2, :state=>"solid"}, "HCl"=>{:compound=>#<Eulim::Chemistry::Compound:0x00000002cabdc0 @formula="HCl", @constituents={"H"=>{:element=>#<Eulim::Chemistry::Element:0x000000025e5ab8 @name="Hydrogen", @symbol="H", @atomic_number=1, @atomic_mass=#<Unitwise::Measurement value=1.0079 unit=u>>, :atom_count=>1}, "Cl"=>{:element=>#<Eulim::Chemistry::Element:0x00000002c82c90 @name="Chlorine", @symbol="Cl", @atomic_number=17, @atomic_mass=#<Unitwise::Measurement value=35.453 unit=u>>, :atom_count=>1}}, @molecular_mass=#<Unitwise::Measurement value=36.4609 unit=u>>, :stoichiometry=>2, :state=>"aqueous"}}, :products=>{"NaCl"=>{:compound=>#<Eulim::Chemistry::Compound:0x00000002c8cda8 @formula="NaCl", @constituents={"Na"=>{:element=>#<Eulim::Chemistry::Element:0x00000002c88e10 @name="Sodium", @symbol="Na", @atomic_number=11, @atomic_mass=#<Unitwise::Measurement value=22.9897 unit=u>>, :atom_count=>1}, "Cl"=>{:element=>#<Eulim::Chemistry::Element:0x00000002c82c90 @name="Chlorine", @symbol="Cl", @atomic_number=17, @atomic_mass=#<Unitwise::Measurement value=35.453 unit=u>>, :atom_count=>1}}, @molecular_mass=#<Unitwise::Measurement value=58.4427 unit=u>>, :stoichiometry=>2, :state=>"aqueous"},"H2"=>{:compound=>#<Eulim::Chemistry::Compound:0x00000002c6f938 @formula="H2", @constituents={"H"=>{:element=>#<Eulim::Chemistry::Element:0x000000025e5ab8 @name="Hydrogen", @symbol="H", @atomic_number=1, @atomic_mass=#<Unitwise::Measurement value=1.0079 unit=u>>, :atom_count=>2}}, @molecular_mass=#<Unitwise::Measurement value=2.0158 unit=u>>, :stoichiometry=>1, :state=>"gaseous"}}}, @is_valid=true, @is_balanced=true>

Related Research Articles

In chemistry, a chemical formula is a way of presenting information about the chemical proportions of atoms that constitute a particular chemical compound or molecule, using chemical element symbols, numbers, and sometimes also other symbols, such as parentheses, dashes, brackets, commas and plus (+) and minus (−) signs. These are limited to a single typographic line of symbols, which may include subscripts and superscripts. A chemical formula is not a chemical name, and it contains no words. Although a chemical formula may imply certain simple chemical structures, it is not the same as a full chemical structural formula. Chemical formulae can fully specify the structure of only the simplest of molecules and chemical substances, and are generally more limited in power than chemical names and structural formulae.

<span class="mw-page-title-main">Diatomic molecule</span> Molecule composed of any two atoms

Diatomic molecules are molecules composed of only two atoms, of the same or different chemical elements. If a diatomic molecule consists of two atoms of the same element, such as hydrogen or oxygen, then it is said to be homonuclear. Otherwise, if a diatomic molecule consists of two different atoms, such as carbon monoxide or nitric oxide, the molecule is said to be heteronuclear. The bond in a homonuclear diatomic molecule is non-polar.

<span class="mw-page-title-main">Ionic bonding</span> Chemical bonding involving attraction between ions

Ionic bonding is a type of chemical bonding that involves the electrostatic attraction between oppositely charged ions, or between two atoms with sharply different electronegativities, and is the primary interaction occurring in ionic compounds. It is one of the main types of bonding along with covalent bonding and metallic bonding. Ions are atoms with an electrostatic charge. Atoms that gain electrons make negatively charged ions. Atoms that lose electrons make positively charged ions. This transfer of electrons is known as electrovalence in contrast to covalence. In the simplest case, the cation is a metal atom and the anion is a nonmetal atom, but these ions can be of a more complex nature, e.g. molecular ions like NH+
4
or SO2−
4
. In simpler words, an ionic bond results from the transfer of electrons from a metal to a non-metal in order to obtain a full valence shell for both atoms.

The molecular mass (m) is the mass of a given molecule: it is measured in daltons. Different molecules of the same compound may have different molecular masses because they contain different isotopes of an element. The related quantity relative molecular mass, as defined by IUPAC, is the ratio of the mass of a molecule to the unified atomic mass unit and is unitless. The molecular mass and relative molecular mass are distinct from but related to the molar mass. The molar mass is defined as the mass of a given substance divided by the amount of a substance and is expressed in g/mol. That makes the molar mass an average of many particles or molecules, and the molecular mass the mass of one specific particle or molecule. The molar mass is usually the more appropriate figure when dealing with macroscopic (weigh-able) quantities of a substance.

<span class="mw-page-title-main">Proton</span> Subatomic particle with positive charge

A proton is a stable subatomic particle, symbol
p
, H+, or 1H+ with a positive electric charge of +1 e elementary charge. Its mass is slightly less than that of a neutron and 1,836 times the mass of an electron (the proton–electron mass ratio). Protons and neutrons, each with masses of approximately one atomic mass unit, are jointly referred to as "nucleons" (particles present in atomic nuclei).

<span class="mw-page-title-main">Stoichiometry</span> Calculation of relative quantities of reactants and products in chemical reactions

Stoichiometry refers to the relationship between the quantities of reactants and products before, during, and following chemical reactions.

The mole, symbol mol, is the unit of amount of substance in the International System of Units (SI). The quantity amount of substance is a measure of how many elementary entities of a given substance are in an object or sample. The mole is defined as containing exactly 6.02214076×1023 elementary entities. Depending on what the substance is, an elementary entity may be an atom, a molecule, an ion, an ion pair, or a subatomic particle such as an electron. For example, 10 moles of water (a chemical compound) and 10 moles of mercury (a chemical element), contain equal amounts of substance and the mercury contains exactly one atom for each molecule of the water, despite the two having different volumes and different masses.

<span class="mw-page-title-main">Avogadro constant</span> Fundamental physical constant representing the molar number of entities

The Avogadro constant, commonly denoted NA or L, is the proportionality factor that relates the number of constituent particles (usually molecules, atoms or ions) in a sample with the amount of substance in that sample. It is an SI defining constant with an exact value of 6.02214076×1023 reciprocal moles. It is named after the Italian scientist Amedeo Avogadro by Stanislao Cannizzaro, who explained this number four years after Avogadro's death while at the Karlsruhe Congress in 1860.

The dalton or unified atomic mass unit is a non-SI unit of mass widely used in physics and chemistry. It is defined as 112 of the mass of an unbound neutral atom of carbon-12 in its nuclear and electronic ground state and at rest. The atomic mass constant, denoted mu, is defined identically, giving mu = m(12C)/12 = 1 Da.

In chemistry, the molar mass of a chemical compound is defined as the mass of a sample of that compound divided by the amount of substance which is the number of moles in that sample, measured in moles. The molar mass is a bulk, not molecular, property of a substance. The molar mass is an average of many instances of the compound, which often vary in mass due to the presence of isotopes. Most commonly, the molar mass is computed from the standard atomic weights and is thus a terrestrial average and a function of the relative abundance of the isotopes of the constituent atoms on Earth. The molar mass is appropriate for converting between the mass of a substance and the amount of a substance for bulk quantities.

A chemical equation is the symbolic representation of a chemical reaction in the form of symbols and chemical formulas. The reactant entities are given on the left-hand side and the product entities on the right-hand side with a plus sign between the entities in both the reactants and the products, and an arrow that points towards the products to show the direction of the reaction. The chemical formulas may be symbolic, structural, or intermixed. The coefficients next to the symbols and formulas of entities are the absolute values of the stoichiometric numbers. The first chemical equation was diagrammed by Jean Beguin in 1615.

Relative atomic mass, also known by the deprecated synonym atomic weight, is a dimensionless physical quantity defined as the ratio of the average mass of atoms of a chemical element in a given sample to the atomic mass constant. The atomic mass constant is defined as being 1/12 of the mass of a carbon-12 atom. Since both quantities in the ratio are masses, the resulting value is dimensionless; hence the value is said to be relative.

<span class="mw-page-title-main">Mass number</span> Number of heavy particles in the atomic nucleus

The mass number, also called atomic mass number or nucleon number, is the total number of protons and neutrons in an atomic nucleus. It is approximately equal to the atomic mass of the atom expressed in atomic mass units. Since protons and neutrons are both baryons, the mass number A is identical with the baryon number B of the nucleus. The mass number is different for each isotope of a given chemical element, and the difference between the mass number and the atomic number Z gives the number of neutrons (N) in the nucleus: N = AZ.

In chemistry, the amount of substance n in a given sample of matter is defined as the quantity or number of discrete atomic-scale particles in it divided by the Avogadro constant NA. The particles or entities may be molecules, atoms, ions, electrons, or other, depending on the context, and should be specified (e.g. amount of sodium chloride nNaCl). The value of the Avogadro constant NA has been defined as 6.02214076×1023 mol−1. The mole (symbol: mol) is a unit of amount of substance in the International System of Units, defined (since 2019) by fixing the Avogadro constant at the given value. Sometimes, the amount of substance is referred to as the chemical amount.

<span class="mw-page-title-main">Lead(II) chloride</span> Chemical compound

Lead(II) chloride (PbCl2) is an inorganic compound which is a white solid under ambient conditions. It is poorly soluble in water. Lead(II) chloride is one of the most important lead-based reagents. It also occurs naturally in the form of the mineral cotunnite.

In chemistry, equivalent weight is the mass of one equivalent, that is the mass of a given substance which will combine with or displace a fixed quantity of another substance. The equivalent weight of an element is the mass which combines with or displaces 1.008 gram of hydrogen or 8.0 grams of oxygen or 35.5 grams of chlorine. These values correspond to the atomic weight divided by the usual valence; for oxygen as example that is 16.0 g / 2 = 8.0 g.

ISO 31-8 is the part of international standard ISO 31 that defines names and symbols for quantities and units related to physical chemistry and molecular physics.

This glossary of chemistry terms is a list of terms and definitions relevant to chemistry, including chemical laws, diagrams and formulae, laboratory tools, glassware, and equipment. Chemistry is a physical science concerned with the composition, structure, and properties of matter, as well as the changes it undergoes during chemical reactions; it features an extensive vocabulary and a significant amount of jargon.

Nomenclature of Inorganic Chemistry, IUPAC Recommendations 2005 is the 2005 version of Nomenclature of Inorganic Chemistry. It is a collection of rules for naming inorganic compounds, as recommended by the International Union of Pure and Applied Chemistry (IUPAC).

<span class="mw-page-title-main">Metal halides</span>

Metal halides are compounds between metals and halogens. Some, such as sodium chloride are ionic, while others are covalently bonded. A few metal halides are discrete molecules, such as uranium hexafluoride, but most adopt polymeric structures, such as palladium chloride.

References

  1. "Releases". Github. Retrieved 1 September 2019.
  1. "eulim | RubyGems.org | your community gem host". rubygems.org. Retrieved 2017-07-11.
  2. "GitHub - syedfazilbasheer-quester/eulim-gem". github.com. Retrieved 2017-07-11.