Function Repository Resource:

LimitingReagent

Source Notebook

Get data on the limiting reactant in a chemical reaction

Contributed by: Peter Burbery

ResourceFunction["LimitingReagent"][reaction,{chem1,chem2,}]

returns a ChemicalInstance object representing the limiting reagent using chemical instances chemi based on reaction.

ResourceFunction["LimitingReagent"][reaction,{chem1,chem2,},property]

gets data for property on the limiting reagent from among the chemical instances chemi based on reaction.

ResourceFunction["LimitingReagent"][reaction,{chem1,chem2,},All]

gets data for all properties on the limiting reagent from among the chemical instances chemi based on reaction.

Details

A reactant is also known as a reagent.
The reaction should be a ChemicalReaction and the chemi should be ChemicalInstance objects.
The output contains the following keys:
ResourceFunction["LimitingReagent"]the limiting reagent/reactant's ChemicalInstance
LimitingChemicalthe limiting reagent/reactant
ExcessReagentsa list of excess reagents. For more details like how many is or much is left, see LeftOverAssociation and LeftOverDataset.
LimitingReagentReactionAssociationan association with details of what actually reacts
LimitingReagentReactionLimitingReagentReactionAssociation in dataset form for increased readability
ReactionDataAssociationan association of the reaction that would occur for each of the chemical instances
ReactionDataDatasetthis is the same as ReactionDataAssociation, but as a Dataset instead of an Association
LeftOverAssociationdata on what reagents are left over. The limiting reagent should have 0 g left over. The reagents in excess will have some left over. This gives data on the excess reagents.
LeftOverDatasetthis is the same as LeftOverAssociation, but as a Dataset instead of an Association

Examples

Basic Examples (3) 

Find the limiting reagent:

In[1]:=
ResourceFunction[
 "LimitingReagent"][ChemicalReaction[<|Entity[
     "Chemical", "Methanol"] -> 2, Entity["Chemical", "MolecularOxygen"] -> 3|> -> <|Entity[
     "Chemical", "CarbonDioxide"] -> 2, Entity["Chemical", "Water"] -> 4|>], {ChemicalInstance[
   Entity["Chemical", "Methanol"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "MolecularOxygen"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "CarbonDioxide"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "Water"], Quantity[1, "Megagrams"]]}]
Out[1]=

Lists of properties are supported:

In[2]:=
ResourceFunction[
 "LimitingReagent"][ChemicalReaction[<|Entity[
     "Chemical", "Methanol"] -> 2, Entity["Chemical", "MolecularOxygen"] -> 3|> -> <|Entity[
     "Chemical", "CarbonDioxide"] -> 2, Entity["Chemical", "Water"] -> 4|>], {ChemicalInstance[
   Entity["Chemical", "Methanol"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "MolecularOxygen"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "CarbonDioxide"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "Water"], Quantity[1, "Megagrams"]]}, {"LimitingReagent", "ExcessReagents", "LimitingReagentReactionDataset"}]
Out[2]=

Get all the data:

In[3]:=
ResourceFunction[
 "LimitingReagent"][ChemicalReaction[<|Entity[
     "Chemical", "Methanol"] -> 2, Entity["Chemical", "MolecularOxygen"] -> 3|> -> <|Entity[
     "Chemical", "CarbonDioxide"] -> 2, Entity["Chemical", "Water"] -> 4|>], {ChemicalInstance[
   Entity["Chemical", "Methanol"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "MolecularOxygen"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "CarbonDioxide"], Quantity[1, "Megagrams"]], ChemicalInstance[Entity["Chemical", "Water"], Quantity[1, "Megagrams"]]}, All]
Out[3]=

Applications (2) 

Openstax Chemistry Atoms First 2e (2) 

What is the limiting reagent when 2.00 g of Si and 1.50 g of N2 react according to the following reaction? 3Si(s)+2N2(g)Si3N4(s) (Source—Openstax Chemistry Atoms First 2e page 335):

In[4]:=
ResourceFunction["LimitingReagent"][
 ChemicalReaction[<|Entity["Chemical", "Silicon"] -> 3, Entity["Chemical", "MolecularNitrogen"] -> 2|> -> <|
    Entity["Chemical", "SiliconNitride"] -> 1|>], {ChemicalInstance[
   Entity["Chemical", "Silicon"], Quantity[2.`, "Grams"]], ChemicalInstance[Entity["Chemical", "MolecularNitrogen"], Quantity[1.5`, "Grams"]]}]
Out[4]=

Which is the limiting reagent when 5.00 g of H2 and 10.0 g of O2 react and form water? (source—page 336)

In this case, ReactionBalance will automatically balance the chemical reaction in case entered a coefficient of 1 for all reagents and products produces an unbalanced reaction:

In[5]:=
ResourceFunction["LimitingReagent"][
 ChemicalReaction[<|Entity["Chemical", "MolecularHydrogen"] -> 1, Entity["Chemical", "MolecularOxygen"] -> 1|> -> <|
    Entity["Chemical", "Water"] -> 1|>], {ChemicalInstance[
   Entity["Chemical", "MolecularHydrogen"], Quantity[5.`, "Grams"]], ChemicalInstance[Entity["Chemical", "MolecularOxygen"], Quantity[10`, "Grams"]]}]
Out[5]=

Possible Issues (1) 

Entity instances are not currently supported:

In[6]:=
ResourceFunction["LimitingReagent"][
 ChemicalReaction[<|Entity["Chemical", "Silicon"] -> 3, EntityInstance[
      Entity["Chemical", "MolecularNitrogen"], {"Phase" -> "Gas"}] -> 2|> -> <|Entity["Chemical", "SiliconNitride"] -> 1|>], {ChemicalInstance[Entity["Chemical", "Silicon"], Quantity[2.`, "Grams"]], ChemicalInstance[Entity["Chemical", "MolecularNitrogen"], Quantity[1.5`, "Grams"]]}]
Out[6]=

Publisher

Peter Burbery

Requirements

Wolfram Language 14.0 (January 2024) or above

Version History

  • 1.0.0 – 20 November 2023

Related Resources

Author Notes

I have another function that computes yield that I plan to submit after this one.

License Information