This simulation emulates the gas phase equilibria between hydrogen, bromine and hydrogen bromide molecules.
http://weelookang.blogspot.sg/2014/12/hydrogen-bromine-hydrogen-bromide.html
H2 + Br2 ⇌ 2HBr (∆H = -103 kJ mol-1)
Constants:
kB = R / NA = 1.38060445E23
R = 8.314
NA = 6.022E-23
Parameters:
Hydrogen are white particles. (mass = 2*1.00794 u)
Bromine are red particles. (mass = 2* 79.904 u)
Hydrogen bromide are green particles. (mass = 79.904 + 1.00794 u)
N = 100 molecules
H-H bond: 436 kJ mol-1
Br-Br bond: 193 kJ mol-1
H-Br bond: 366 kJ mol-1
∆H = -103 kJ mol-1
kf = Aexp(-629/8.314/T)
kb = Aexp(-732/8.314/T)
Keq = kf/kb = exp(103/8.314/T)
Fixed relations
v = Math.sqrt(3*8.314/6.022*10E23*T/mass)