Oxygen balance

How I stopped worrying and learned to calculate the oxygen balance in JavaScript

Antanas

10/21/20251 min read

So, as I was bashing away at the keyboard to finish up my calkem calculator I was also searching for a nice example to have in the default input, in particular, to showcase the newly added capacity for parsing textual chemical formula containing brackets. Since the best-known examples of structural-oxygen-balance dangers (simply: the ratio of oxygen to fuel in a molecule) are explosives - I checked the usual suspects (TNT, RDX, Nitroglycerin) on wikipedia. Then this molecule popped into view:

TKX-50, (CH4N5O2)2, wikipedia

It also came with the selling point of "an environmentally-friendly replacement for several conventional explosives." [c&en article]

I am no explosives expert but i find it very interesting indeed to challenge the long standing conventional molecules used for the purposes of blowing stuff up. Some of these predate the second industrial revolution:

  • Nitroglycerin: 1847 Ascanio Sobrero, Italy, C3H5(NO3)3  - explosive component in Dynamite, popularized by Alfred Nobel.

  • TNT: 1863, Julius Wilbrand, Germany, C6H2(NO2)3CH3 - polpularized by AC/DC, as well as various strategic bombing campaigns.

  • RDX: 1898, Georg Friedrich Henning, Germany, (CH2N2O2)3  - explosive component in C-4, popularized by CS 1.6.

Wikipedia, as entertaining as it is, also shows the synthesis of the substance:

Despite the awe-inspiring synthetic strategy depicted in the synthesis scheme, making the final salt is not the key takeaway. The page does also mention the iterative development of the manufacturing process by various parties. This indeed suggests an interest in the molecule. AC/DC should best look into what rhymes with TKX-50. One may also reflect on the fact that the molecule appears, by definition, to be inorganic, challenging the reign of organic chemistry in yet another explosive industry.

But do check out the new Calculator if you're still here. I hope to add more functionality as I pick-up new tricks in JS. Cheers! //Antanas