Chemistry
Chemistry
My name is Peter Burbery. I would like to demonstrate some work of mine with chemistry functions.
The important functions I will be using are ChemicalReaction, ReactionBalance, ReactionBalancedQ, ChemicalInstance, and ChemicalFormula. I use ChemicalReaction to represent chemical reactions.
Introduction
ReactionData
Let’s use ReactionData for stoichiometry.
We have the reaction Cr ⟶ ++4O. We have 1.234 kg of . For each chemical in the equation, calculate how the mass, moles, and number of molecules using stoichiometry and molar ratios:
(N)
H
4
2
O
4
N
2
Cr
2
O
3
H
2
(N)
H
4
2
Cr
2
O
7
In[]:=
reaction=ChemicalReaction<|->1|>-><|->1,->1,->4|>
Out[]=
ChemicalReaction
In[]:=
ResourceFunction["ReactionData"]reaction,ChemicalInstance,
Out[]=
Use an association instead of a dataset:
In[]:=
ResourceFunction["ReactionData"]reaction,ChemicalInstance,,"Association"
Applications
Applications
LimitingReagent
We have . We have 1 Mg of each reactant and product. What is the limiting reactant? What reactants are in excess? How much of the excess reactant is left over? What would we need for an ideal reaction for each case? Give moles, mass, and molecules for each case.
2COH+3 ⟶ 2C+4O
H
3
O
2
O
2
H
2
In[]:=
ResourceFunction[CloudObject["https://www.wolframcloud.com/obj/burbery1/DeployedResources/Function/LimitingReagent"]]ChemicalReaction[<|Entity["Chemical","Methanol"]->2,Entity["Chemical","MolecularOxygen"]->3|>-><|Entity["Chemical","CarbonDioxide"]->2,Entity["Chemical","Water"]->4|>],ChemicalInstance,,ChemicalInstance,,ChemicalInstance,,ChemicalInstance,
Out[]=
LimitingReagent,ExcessReagents,LimitingReagentReactionAssociationMass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,LimitingReagentReactionDataset
,ReactionDataAssociationChemicalInstance,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,ChemicalInstance,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,ChemicalInstance,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,ChemicalInstance,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,Mass,Amount,MoleculeCount,ReactionDataset
,LeftOverAssociationMass,Amount,Molecules,Mass,Amount,Molecules,Mass,Amount,Molecules,Mass,Amount,Molecules,LeftOverDataset
Please visit https://www.wolframcloud.com/obj/burbery1/DeployedResources/Function/LimitingReagent/ for more details.
LimitingIngredient
I made a function LimitingIngredient that has some issues with a cell. The function is available at https://www.wolframcloud.com/obj/burbery1/DeployedResources/Function/LimitingIngredient/.
This is from Chem Libretexts:
When there is not enough of one reactant in a chemical reaction, the reaction stops abruptly. To figure out the amount of product produced, it must be determined which reactant will limit the chemical reaction (the limiting reagent) and which reactant is in excess (the excess reagent). One way of finding the limiting reagent is by calculating the amount of product that can be formed by each reactant; the one that produces less product is the limiting reagent. The following scenario illustrates the significance of limiting reagents. In order to assemble a car, 4 tires and 2 headlights are needed (among other things). In this example, imagine that the tires and headlights are reactants while the car is the product formed from the reaction of 4 tires and 2 headlights. 4 tires+2 headlights=1 car
If you have 20 tires and 14 headlights, how many cars can be made? With 20 tires, 5 cars can be produced because there are 4 tires to a car. With 14 headlights, 7 cars can be built (each car needs 2 headlights). Although more cars can be made from the headlights available, only 5 full cars are possible because of the limited number of tires available. In this case, the headlights are in excess. Because the number of cars formed by 20 tires is less than number of cars produced by 14 headlights, the tires are the limiting reagent (they limit the full completion of the reaction, in which all of the reactants are used up).
I want to verify their analysis:
When there is not enough of one reactant in a chemical reaction, the reaction stops abruptly. To figure out the amount of product produced, it must be determined which reactant will limit the chemical reaction (the limiting reagent) and which reactant is in excess (the excess reagent). One way of finding the limiting reagent is by calculating the amount of product that can be formed by each reactant; the one that produces less product is the limiting reagent. The following scenario illustrates the significance of limiting reagents. In order to assemble a car, 4 tires and 2 headlights are needed (among other things). In this example, imagine that the tires and headlights are reactants while the car is the product formed from the reaction of 4 tires and 2 headlights. 4 tires+2 headlights=1 car
If you have 20 tires and 14 headlights, how many cars can be made? With 20 tires, 5 cars can be produced because there are 4 tires to a car. With 14 headlights, 7 cars can be built (each car needs 2 headlights). Although more cars can be made from the headlights available, only 5 full cars are possible because of the limited number of tires available. In this case, the headlights are in excess. Because the number of cars formed by 20 tires is less than number of cars produced by 14 headlights, the tires are the limiting reagent (they limit the full completion of the reaction, in which all of the reactants are used up).
I want to verify their analysis:
In[]:=
ResourceFunction[CloudObject["https://www.wolframcloud.com/obj/burbery1/DeployedResources/Function/LimitingIngredient"]][<|"tire"->4,"headlight"->2|>-><|"car"->1|>,{{"tire",20},{"headlight",14}}]
Out[]=
limitingitemtire,excessitems{headlight},limitingitemrelationtire20,headlight10car5,leftoverheadlight4,tire0,relationstiretire20,headlight10car5,headlighttire28,headlight14car7,factors{{tire,20}5,{headlight,14}7}
Consider another food analogy, making grilled cheese sandwiches (Figure 7.13): 1 slice of cheese+2 slices of bread⟶1 sandwich Stoichiometric amounts of sandwich ingredients for this recipe are bread and cheese slices in a 2:1 ratio. Provided with 28 slices of bread and 11 slices of cheese, one may prepare 11 sandwiches per the provided recipe, using all the provided cheese and having six slices of bread left over. In this scenario, the number of sandwiches prepared has been limited by the number of cheese slices, and the bread slices have been provided in excess:
Yield
This is available at https://www.wolframcloud.com/obj/burbery1/DeployedResources/Function/Yield/. There are issues with the cloud notebook.
Hess’s Law
I made a function to compute Hess’s Law. Please visit https://www.wolframcloud.com/obj/burbery1/DeployedResources/Function/HessLaw/ if you are interested.
The problem is the reaction that changes the state of HCl with delta H of -74.8 KJ and the reaction that changes the state of AlCl3 with a delta H of 323 KJ. There might be a way to account for this using EntityInstance. At the moment, I am going to say that unfortunately, Hess law problems with things like HCl(g)->HCl(aq) and AlCl3(aq)->AlCl(s) are not supported.
Combustion Reaction
This is from ReactionBalance’s documentation Application section.
Write a function to return balanced combustion reactions:
Find the balanced reactions to combust several hydrocarbons:
the paclet WolframChemistry/ChemistryFunctions
I would like to mention that the paclet WolframChemistry/ChemistryFunctions has a very helpful function for going from composition (I don’t like to say percent composition) to the molar formula and the molecular formula of a chemical.
Find the empirical formula for a compound that is 64.3% carbon, 7.2% hydrogen, and 28.5% oxygen:
Create a plot showing the electrons in the radioactive element californium:
Other
Significant Figures
Significant Figures
To calculate significant figures, please use https://www.chemicalaid.com/’s calculator https://www.chemicalaid.com/tools/sigfigscalculator.php
Chemical Reaction Examples
Chemical Reaction Examples
For examples of chemical reactions, please visit https://chemequations.com/en/.
Other helpful resources include the free online Openstax Chemistry Atoms First 2e and Chemistry Libretexts.