-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
68 lines (52 loc) · 1.32 KB
/
index.html
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
65
66
67
68
<html>
<head>
<script type="text/javascript"
src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<style>
#input {
position: absolute; top: 0; left: 0; bottom: 0;
width: 50%; height: 100%;
}
#output {
position: absolute; top: 0; right: 0; bottom: 0;
overflow: auto;
width: 50%; height: 100%;
}
</style>
<script src="grammar.js"></script>
<script src="chemical.js"></script>
<script src="index.js"></script>
</head>
<body>
<textarea id="input">
## Buffers
#Suppose we are studying acid/base equilibria. We have in a buffer solution:
A = 0.1
HA = 0.1
K_a = 1.6e-4
# Stipulate can solve this equation for us, at least approximately:
SOLVE H | (H + A) * H / (HA - H) = K_a
# And then we can get pH:
pH = -log(H)
## Percent Ionization
# Or, suppose we were given that we had 4% ionization for 0.1 mol in 100 mL of water:
percent_ionization = 0.04
HA = 0.1
V = 0.1
# And we need to find Ka.
H = percent_ionization * HA
HA_f = HA - H
K_a = H^2/HA_f
## Molar Mass
# What if we only knew that we threw 4g of sodium chloride into 100 L of water? What's the concentration?
m = 4
v = 0.1
# No problem, Stipulate can look molar mass up for us:
n = m / mm:{NaC2H3O2}
M = n / v
</textarea>
<div id="output">
</div>
</body>
</html>