theosanderson / mixology

Buffer making tool
https://mixology.science
MIT License
7 stars 2 forks source link

pH calculation #4

Open theosanderson opened 3 years ago

theosanderson commented 3 years ago

Requested: https://twitter.com/wolfgang_xl/status/1335730888290660352

Pubchem seems to have pka data [ed: but pretty sporadic?]

From that one can calculate pH with https://courses.lumenlearning.com/boundless-chemistry/chapter/buffer-solutions/#:~:text=The%20formula%20for%20the%20Henderson,conjugate%20base%20and%20starting%20acid.

theosanderson commented 3 years ago

but seems hard to figure out exactly how this would work in UI terms

theosanderson commented 3 years ago

Ok I'm starting to see how this could work: an option to add a "buffer-pair" which is like 2 compounds but they are linked and you set the pH caused by them - we don't try to model any other compounds. We'd manually add a bunch of standard pairs. Hmm could have legs.

theosanderson commented 3 years ago

For the pair the user picks 2 of these 4 variables to specify, using checkboxes (grayed out once two ticked)

-pH -conc acid -conc base -conc acid + conc base (in molarity)

Other 2 are computed reactively

Needed_amount section is then the same as always