Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Format a two-dimensional grid with a chemical reaction as the column headings
ResourceFunction["ReactionGrid"][reaction,data] builds a two-dimensional grid from data with the chemicals in reaction as column headings. |
"DefaultValue" | Null | value used by PadRight to fill in missing data |
"FormulaStyle" | Automatic | additional Style options for formatting chemical formulas |
"IncludeCoefficients" | False | include existing stochiometric coefficients in column headings |
"Labels" | {Text["Reactants:"],Text["\nProducts:"]} | labels used when "SplitReaction" is True |
"Offset" | Automatic | Integer number of columns preceeding the chemical data |
"SplitReaction" | False | return the reactant and product data as separate grids in a Column |
"ReactionArrow" | → | arrow to use when "SplitReaction" is False |
Display names and stoichiometric coefficients in a Grid:
In[1]:= |
Out[1]= |
Include row labels and use Text to format grid elements as text:
In[2]:= |
Out[2]= |
Return the reactants and products as separate grids:
In[3]:= |
Out[3]= |
Build an empty table for the reaction between zinc hydroxide and hydrogen chloride:
In[4]:= |
Out[4]= |
An equivalent specification:
In[5]:= |
Out[5]= |
Include stoichiometric coefficients when "IncludeCoefficients" is True:
In[8]:= |
Out[8]= |
Account for the presence of other columns of information in data by passing in an offset when the length of each row is less than the number of reactants and products:
In[10]:= |
Out[10]= |
Return the reactant and product data as separate grids in a Column:
In[11]:= |
Out[11]= |
Change the reaction arrow used in the grid header:
In[12]:= |
Out[12]= |
The reactant and product grids can be extracted with Part:
In[13]:= |
Out[13]= |
In[14]:= |
Out[14]= |
Duplicate chemicals are automatically combined by ChemicalReaction:
In[15]:= |
Out[15]= |
Use an alternative specification for ChemicalReaction employing an Entity and a ChemicalFormula to prevent such behavior:
In[16]:= |
Out[16]= |
Heterogeneous data may skew alignment of + and → with the Frame lines:
In[17]:= |
Out[17]= |
Use ItemSize to fix that:
In[18]:= |
Out[18]= |
Invalid ChemicalReaction objects fail:
In[19]:= |
Out[19]= |
Build an ICE table to solve chemical equilibrium problems:
In[20]:= |
Out[20]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License