Trivial.Chemistry 4.0.0-preview4

This is a prerelease version of Trivial.Chemistry.
There is a newer version of this package available.
See the version list below for details.
Install-Package Trivial.Chemistry -Version 4.0.0-preview4
dotnet add package Trivial.Chemistry --version 4.0.0-preview4
<PackageReference Include="Trivial.Chemistry" Version="4.0.0-preview4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Trivial.Chemistry --version 4.0.0-preview4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Trivial.Chemistry, 4.0.0-preview4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Trivial.Chemistry as a Cake Addin
#addin nuget:?package=Trivial.Chemistry&version=4.0.0-preview4&prerelease

// Install Trivial.Chemistry as a Cake Tool
#tool nuget:?package=Trivial.Chemistry&version=4.0.0-preview4&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

This library includes the basic chemistry models.

using Trivial.Chemistry;

Element

Get element from periodic table by its symbol or atomic numbers.

var oxygen = ChemicalElement.Get(8);
var gold = ChemicalElement.Get("Au");
var carbon = ChemicalElement.C;

Or list a set of element.

var some = ChemicalElement.Where(ele => ele.AtomicNumber < 20);

Isotope

Create an isotope from an element.

var diplogen = ChemicalElement.H.Isotope(2);

Or list all for a specific element.

var allCarbonIsotopes = ChemicalElement.C.Isotopes();

Molecular formula

Parse a molecular formula.

var carbonicAcid = MolecularFormula.Parse("H2CO3");

Or create a molecular formula by merging elements and other molecular formulas.

var sulfuricAcid = ChemicalElement.H * 2 + ChemicalElement.S + ChemicalElement.O * 4;
var ethanol = MolecularFormula.Parse("CH3") + MolecularFormula.Parse("CH2") + MolecularFormula.Parse("OH");
var iron = ChemicalElement.Fe;

Test conservation of mass.

// 2 Na + 2 H₂O = 2 NaOH + H₂
var mass = MolecularFormula.ConservationOfMass(
    new List<MolecularFormula>
    {
        { ChemicalElement.Na, 2 },
        { ChemicalElement.H * 2 + ChemicalElement.O, 2 }
    },
    new List<MolecularFormula>
    {
        { ChemicalElement.Na + ChemicalElement.H + ChemicalElement.O, 2 },
        ChemicalElement.H * 2
    }
);
Console.WriteLine(mass); // -> True
  • .NETCoreApp 3.1

  • .NETFramework 4.6.1

  • .NETFramework 4.8

  • .NETStandard 2.0

  • net5.0

  • net6.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.1.0 0 12/2/2021
5.0.0 26 11/27/2021
4.0.0 74 11/9/2021
4.0.0-preview4 130 10/13/2021
4.0.0-preview3 68 9/15/2021
4.0.0-preview2 78 8/11/2021
4.0.0-preview1 125 6/18/2021
3.0.0 76 11/9/2021
2.4.0 119 5/30/2021
2.3.0 135 5/23/2021
2.2.0 201 5/19/2021
2.1.0 279 5/17/2021
2.0.0 311 5/16/2021
1.0.1 290 5/13/2021
1.0.0 264 5/13/2021