~johanvandegriff/games.johanv.xyz

games.johanv.xyz/templates/stoichiometry.html -rw-r--r-- 4.6 KiB
39c27b18Johan Vandegriff added dictionary download to dockerfile 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{% include 'header.html' %}
<h2>Stoichiometry</h2>
<p>Chemical Equation Balancer!</p>

<form action="/chem">
Enter the chemical equation to be balanced:
<input required type="text" name="equation" value="{{ equation }}" style="width:400px;">
<br>

<br>
<input value="Balance It!" type="submit">
<h3>Optional Info</h3>
Enter a compound within the equation to set its grams or moles:
<input type="text" name="compound" value="{{ compound }}">
<br>

Enter the quantity and unit of this compound:
<input type="text" name="grams_or_moles_value" value="{{ grams_or_moles_value }}">
<select name="grams_or_moles">
<option{% if grams_or_moles == "grams" %} selected{% endif %}>grams</option>
<option{% if grams_or_moles == "moles" %} selected{% endif %}>moles</option>
</select>

<br>
<input value="Balance It!" type="submit">
</form>

{% if result %}
<h3>Result</h3>
<pre>{{ result }}</pre>
{% else %}
<h3>Samples</h3>
<p>Try out some of these sample equations. It balances charge, too!</p>
<pre>
    <a href="?equation=H2%2BO2%3D>H2O">H2+O2=>H2O</a>
    <a href="?equation=Fe%28l%29+%2B+H2O%28l%29+%3D>+Fe%282%2B%29%28aq%29+%2B+OH%28-%29%28aq%29+%2B+H2%28g%29">Fe(l) + H2O(l) => Fe(2+)(aq) + OH(-)(aq) + H2(g)</a>
    <a href="?equation=C3H6%28OH%292+%2B+O2+->+CO2+%2B+H2O">C3H6(OH)2 + O2 -> CO2 + H2O</a>
    <a href="?equation=Al+%2B+I2+->+AlI3">Al + I2 -> AlI3</a>
    <a href="?equation=NH3+%2B+CO2+%3D>+%28NH2%292CO+%2B+H2O">NH3 + CO2 => (NH2)2CO + H2O</a>
    <a href="?equation=Zn+%2B+HCl+→+ZnCl2+%2B+H2">Zn + HCl → ZnCl2 + H2</a>
    <a href="?equation=TiCl4+%2B+Mg+→+Ti+%2B+MgCl2">TiCl4 + Mg → Ti + MgCl2</a>
    <a href="?equation=NaHCO3+↔+Na2CO3+%2B+CO2%2BH2O">NaHCO3 ↔ Na2CO3 + CO2+H2O</a>
    <a href="?equation=Na2CO3%28aq%29+%2B+HCl%28aq%29+→+++CO2%28g%29+%2B+++NaCl%28aq%29+%2B+++H2O%28l%29">Na2CO3(aq) + HCl(aq) →   CO2(g) +   NaCl(aq) +   H2O(l)</a>
    <a href="?equation=LiBr%28aq%29+%2B+AgNO3%28aq%29+→++LiNO3%28aq%29+%2B+AgBr+%09%09+%28s%29">LiBr(aq) + AgNO3(aq) →  LiNO3(aq) + AgBr 		 (s)</a>
    <a href="?equation=NaOH+%28aq%29+%2B++Cu%28NO3%292+%28aq%29+→++Cu%28OH%292+%28s%29+%2B++NaNO3+%28aq%29">NaOH (aq) +  Cu(NO3)2 (aq) →  Cu(OH)2 (s) +  NaNO3 (aq)</a>
    <a href="?equation=CaI2%28aq%29+%2B+K3PO4%28aq%29+→++Ca3%28PO4%292+%28s%29+%2B++KI+%28aq%29">CaI2(aq) + K3PO4(aq) →  Ca3(PO4)2 (s) +  KI (aq)</a>
    <a href="?equation=Ag%28%2B%29+%28aq%29+%2B+CrO4%282-%29+%28aq%29+→+Ag2CrO4+%28s%29">Ag(+) (aq) + CrO4(2-) (aq) → Ag2CrO4 (s)</a>
    <a href="?equation=Pb%28NO3%292%28s%29+%2B+NaI%28aq%29+→+PbI2%28aq%29+%2B+NaNO3%28aq%29">Pb(NO3)2(s) + NaI(aq) → PbI2(aq) + NaNO3(aq)</a>
    <a href="?equation=NaN3%28s%29+%2B+Fe2O3%28s%29+→+Na2O%28s%29+%2B+Fe%28s%29+%2B++N2%28g%29">NaN3(s) + Fe2O3(s) → Na2O(s) + Fe(s) +  N2(g)</a>
    <a href="?equation=LiOH%28s%29+%2B+CO2%28g%29+→+Li2CO3%28s%29+%2B+H2O%28l%29">LiOH(s) + CO2(g) → Li2CO3(s) + H2O(l)</a>
    <a href="?equation=KOH%28s%29+%2B+CO2%28g%29+→+K2CO3%28s%29+%2B+H2O%28l%29">KOH(s) + CO2(g) → K2CO3(s) + H2O(l)</a>
    <a href="?equation=H2SO4%28aq%29+%2B+Na2CO3%28aq%29+→+CO2%28g%29+%2B+H2O%28l%29+%2B+Na2SO4%28aq%29">H2SO4(aq) + Na2CO3(aq) → CO2(g) + H2O(l) + Na2SO4(aq)</a>
    <a href="?equation=HCl%28aq%29+%2B+Na2CO3%28aq%29+→+CO2%28g%29+%2B+H2O%28l%29+%2B+NaCl%28aq%29">HCl(aq) + Na2CO3(aq) → CO2(g) + H2O(l) + NaCl(aq)</a>
    <a href="?equation=C3H5%28NO3%293%28s%29+%3D+CO2%28g%29+%2B+H2O%28g%29+%2B+N2%28g%29+%2B+O2%28g%29">C3H5(NO3)3(s) = CO2(g) + H2O(g) + N2(g) + O2(g)</a>
    <a href="?equation=C2H5OH%28l%29+%2B+++O2%28g%29+→++%09%09+CO2%28g%29+%2B++%09%09+H2O%28g%29">C2H5OH(l) +   O2(g) →  		 CO2(g) +  		 H2O(g)</a>
    <a href="?equation=CO2%28g%29+%2B+H2O%28l%29+⇆+H3O%28%2B%29%28aq%29+%2B+HCO3%28-%29%28aq%29">CO2(g) + H2O(l) ⇆ H3O(+)(aq) + HCO3(-)(aq)</a>
</pre>
{% endif %}

<h3>Source Code</h3>
<p>This app is open source! You can see, modify, and distribute the source code.</p>
<p>You can see the source code for the actual solver (under the <a target="_blank" href="https://tldrlegal.com/license/mit-license">MIT license</a>) on <a target="_blank" href="https://git.sr.ht/~johanvandegriff/Stoichiometry">sourcehut</a> or <a target="_blank" href="https://github.com/johanvandegriff/Stoichiometry">github</a>. The source code for this web page (under the <a target="_blank" href="https://tldrlegal.com/license/gnu-affero-general-public-license-v3-(agpl-3.0)">AGPLv3 license</a>) is also on <a target="_blank" href="https://git.sr.ht/~johanvandegriff/games.johanv.xyz/tree/master/item/games.py">sourcehut</a> or <a target="_blank" href="https://github.com/johanvandegriff/games.johanv.xyz/blob/master/games.py">github</a>.</p>

{% include 'footer.html' %}