Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download

Balancing Chemical Reactions

Views: 16
Image: ubuntu2204
# Eli Ingram, Geneva Mathews, Gracie Schindler # 10/24/2023 # Project 3 # Problem 3.8A # a*(C2H6) + b*(O2) --> c*(CO2) + d*(H2O) This is the unbalanced equation. var ('a b c d')
(a, b, c, d)
# This equation balances the number of carbon atoms on both sides of the reaction. 2*a == c
2*a == c
# Problem 3.8B # These equations balance the number of hydrogen and oxygen atoms in the reaction. 6*a == 2*d
6*a == 2*d
2*b == 2*c + d
2*b == 2*c + d
# Problem 3.8C Rxn = matrix([[2,0,1,0],[6,0,0,2],[0,2,2,1]]) print(Rxn.rref()*6) # There are infinitely-many solutions because there is a free-variable present. # We multiplied this coefficeint matrix by 6 because we cannot have a fraction molecule in our reaction.
[ 6 0 0 2] [ 0 6 0 7] [ 0 0 6 -4]
# Solution to this system: a = -1/3(d), b = -7/6(d), c = 2/3(d) # 2(C2H6) + 7(O2) --> 4(CO2) + 6(H2O) This is the balanced equation. # Problem 3.9A # a*(C6H12O6) + b*(O2) --> c*(CO2) + d*(H2O) This is the unbalanced equation. var ('a, b, c, d')
(a, b, c, d)
# Set up equations that balances the number of carbon atoms on both sides of the reaction. 6*a == c
6*a == c
2*b == 2*c + d
2*b == 2*c + d
c == 6*a
Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python3.11/site-packages/smc_sagews/sage_server.py", line 1244, in execute exec( File "", line 1, in <module> NameError: name 'c' is not defined
2*d == 12*a
2*d == 12*a
Rxn = matrix([[6,0,-1,0],[12,0,0,-2],[6,2,-2,-1]]) print(Rxn.rref()*6)
[ 6 0 0 -1] [ 0 6 0 -6] [ 0 0 6 -6]
# By balancing the carbon and hydrogen atoms, and thus the equation we get this balanced chemical equation: # 1(C6H12O6) + 6(O2) --> 6(CO2) + 6(H2O) # Problem 3.9B # a*(Mg) + b*(CO2) --> c*(MgO) + d*(C) This is the unbalanced equation. var ('a, b, c, d')
(a, b, c, d)
a == c
a == c
b == d
Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python3.11/site-packages/smc_sagews/sage_server.py", line 1244, in execute exec( File "", line 1, in <module> NameError: name 'b' is not defined
2*b == c
Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python3.11/site-packages/smc_sagews/sage_server.py", line 1244, in execute exec( File "", line 1, in <module> NameError: name 'b' is not defined
Rxn = matrix([[0,1,0,1],[1,0,1,0],[0,2,1,0]]) print(Rxn.rref())
[ 1 0 0 2] [ 0 1 0 1] [ 0 0 1 -2]