Function Repository Resource:

ReactionData

Source Notebook

Get data on a chemical reaction

Contributed by: Peter Burbery

ResourceFunction["ReactionData"][react, inst]

gives data for the ChemicalReaction react based on ChemicalInstance inst.

ResourceFunction["ReactionData"][react, inst, format]

gives data in the specified output format.

Details

The format options are "Dataset" (default) and "Association".

Examples

Basic Examples (3) 

Define a chemical reaction:

In[1]:=
reaction = ChemicalReaction[<|
    Entity["Chemical", "AmmoniumDichromate"] -> 1|> -> <|
    Entity["Chemical", "MolecularNitrogen"] -> 1, Entity["Chemical", "ChromiumIIIOxide"] -> 1, Entity["Chemical", "Water"] -> 4|>]
Out[1]=

Summarize the products and reactants given 1.234 kg of ammonium bichromate:

In[2]:=
ResourceFunction["ReactionData"][reaction, ChemicalInstance[Entity["Chemical", "AmmoniumDichromate"], Quantity[1.234`, "Kilograms"]]]
Out[2]=

Get the result as an Association:

In[3]:=
ResourceFunction["ReactionData"][reaction, ChemicalInstance[Entity["Chemical", "AmmoniumDichromate"], Quantity[1.234`, "Kilograms"]], "Association"]
Out[3]=

Applications (8) 

Specify the reactants as chemical entities:

In[4]:=
entityform = ChemicalReaction[<|
    Entity["Chemical", "AmmoniumDichromate"] -> 1|> -> <|
    Entity["Chemical", "MolecularNitrogen"] -> 1, Entity["Chemical", "ChromiumIIIOxide"] -> 1, Entity["Chemical", "Water"] -> 4|>]
Out[4]=

Specify the chemical formulas as strings:

In[5]:=
formulaform = ChemicalReaction[<|ChemicalFormula["(NH4)2Cr2O7"] -> 1|> -> <|
    ChemicalFormula["N2"] -> 1, ChemicalFormula["Cr2O3"] -> 1, ChemicalFormula["H2O"] -> 4|>]
Out[5]=

We can also use Molecule:

In[6]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/bab9b308-d744-4216-a036-719d7ed21177"]
Out[6]=

Get the reaction data using the entity-based reaction:

In[7]:=
ResourceFunction["ReactionData"][entityform, ChemicalInstance[Entity["Chemical", "Water"], Quantity[1.234`, "Kilograms"]]]
Out[7]=

The keys are entities:

In[8]:=
ResourceFunction["ReactionData"][entityform, ChemicalInstance[Entity["Chemical", "Water"], Quantity[1.234`, "Kilograms"]], "Association"]
Out[8]=

Get the reaction data using the formula-based reaction:

In[9]:=
ResourceFunction["ReactionData"][formulaform, ChemicalInstance[ChemicalFormula[{"H" -> 2, "O" -> 1}], Quantity[1.234`, "Kilograms"]]]
Out[9]=

The keys are ChemicalFormula objects:

In[10]:=
ResourceFunction["ReactionData"][formulaform, ChemicalInstance[ChemicalFormula[{"H" -> 2, "O" -> 1}], Quantity[1.234`, "Kilograms"]], "Association"]
Out[10]=

Get the reaction data using the molecule-based reaction:

In[11]:=
ResourceFunction["ReactionData"][moleculeform, ChemicalInstance[Molecule[{"O"}, {}, {}], Quantity[1.234`, "Kilograms"]]]
Out[11]=

The keys are Molecule objects:

In[12]:=
ResourceFunction["ReactionData"][moleculeform, ChemicalInstance[Molecule[{"O"}, {}, {}], Quantity[1.234`, "Kilograms"]], "Association"]
Out[12]=

There's one more way to do it—by just entering the reaction as a string. This might not work when you have isomers, though:

In[13]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["(NH4)2Cr2O7 -> N2 + Cr2O3 + H2O"], ChemicalInstance[ChemicalFormula["H2O"], Quantity[1.234`, "Kilograms"]]]
Out[13]=

Synthesis Reactions (4) 

One type is a reaction of an element with oxygen and sulfur. Get the reaction data for a random mass of the reactant:

In[14]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2Mg(s)+O2(g)->2MgO(s)"], ChemicalInstance[ChemicalFormula["Mg(s)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[14]=

Here is a reaction of a metal with a halogen:

In[15]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2Na(s)+Cl2(g)->2NaCl(s)"], ChemicalInstance[ChemicalFormula["Na(s)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[15]=

There's also the option to specify a different product or reactant:

In[16]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2Na(s)+Cl2(g)->2NaCl(s)"], ChemicalInstance[ChemicalFormula["Cl2(g)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[16]=
In[17]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2Na(s)+Cl2(g)->2NaCl(s)"], ChemicalInstance[ChemicalFormula["NaCl(s)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[17]=

Synthesis reaction with oxides:

In[18]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2CaO(s)+H2O(l)->Ca(OH)2(s)"], ChemicalInstance[ChemicalFormula["CaO(s)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[18]=

Decomposition Reactions (1) 

Water decomposes into hydrogen gas and oxygen gas:

In[19]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2H2O(l)->2H2(g)+O2(g)"], ChemicalInstance[ChemicalFormula["H2O(l)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[19]=

Single Displacement Reactions (1) 

This is a single displacement reaction/single replacement reaction: Aluminum reacts with plumbous nitrate/lead (II) nitrate to produce lead and aluminium nitrate:

In[20]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2Al(s)+3Pb(NO3)2(aq)->3Pb(s)+2Al(NO3)3(aq)"], ChemicalInstance[ChemicalFormula["Al(s)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[20]=

Double Displacement Reactions (1) 

This is a double displacement reaction/double replacement reaction/metathesis reaction: Potassium iodide reacts with lead(II) nitrate to produce lead(II) iodide and potassium nitrate/saltpeter:

In[21]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2KI(aq)+Pb(NO3)2(aq)->PbI2(s)+2KNO3(aq)"], ChemicalInstance[ChemicalFormula["PbI2(s)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[21]=

Combustion Reactions (1) 

A combustion reaction for hydrogen gas:

In[22]:=
ResourceFunction["ReactionData"][
 ChemicalReaction["2H2(g)+O2(g)->2H2O(g)"], ChemicalInstance[ChemicalFormula["H2(g)"], Echo@Quantity[RandomReal[{1, E^2}], "Kilograms"]]]
Out[22]=

Possible Issues (1) 

A chemical in the reaction must be specified:

In[23]:=
ResourceFunction[
 "ReactionData"][ChemicalReaction[<|Entity[
     "Chemical", "AmmoniumDichromate"] -> 1|> -> <|Entity[
     "Chemical", "MolecularNitrogen"] -> 1, Entity["Chemical", "ChromiumIIIOxide"] -> 1, Entity["Chemical", "Water"] -> 4|>], ChemicalInstance[Entity["Chemical", "SodiumChloride"], Quantity[1.234`, "Kilograms"]]]
Out[23]=

Publisher

Peter Burbery

Requirements

Wolfram Language 13.1 (June 2022) or above

Version History

  • 1.0.0 – 20 October 2023

Related Resources

Author Notes

This is for ideal reactions. I have not added support for limiting reactants and limiting reagents yet.

When using ChemicalReaction, there are several advantages of using chemical entities. One advantage is there's a lot of data associated with it like name, boiling point, melting point, thermodynamic data, alternative names, etc. Another advantage of using chemical entities rather than chemical formulas is that this can handle isomers by looking at the structure to distinguish two chemicals with the same chemical formula but different properties because the structure is different:

License Information