I am trying to come up with a series of minimal media to grow a coculture. there are multiple compound concentrations being varied. I want to calculate the pH of each media. I am having a little bit of a problem calculating the final pH of each complex buffer. For example what would be the pH if I add .34moles of KH2PO4, .34 moles of K2HPO4 and also add .3 moles of (NH4)H2PO4. Thanks
This is not easy - as long as there were only H_{2}PO_{4}^{-} and HPO_{4}^{2-} present in the solution you could use Henderson-Hasselbalch equation. But after adding NH_{4}^{+} - which is an acid - this approach is no longer valid. It can be still calculated from the first principles, but this is not a thing you want to do manually. I would go for pH calculator.
I would like to know how to do it from first principles if possible, I'm trying to develop a quick logarithm to calculate the multiple media. I would rather not buy the calculator if possible. thanks
Solving from first principles means writing all mass balances, charge balance and all equilibrium equations (dissociation constants plus water ion product). This yields a nonlinear system of simultaneous equations. You solve this system and you know pH. Solving manually is difficult - even assuming you can ignore Ka1 and Ka3 for phosphoric acid, you will still end with the system that yields 4th degree polynomial (if I am not mistaken - can be even higher).
OK, I tried to do this accounting for K1,k2,k3 and the other ks but there must be a mistake somewhere since I am not getting the correct pH with my algorithm. I am not including the activity coefficient so maybe there lies the reason for discrepancy. It is quite different though pH=4 predicted for a 7 ph
Would you care to have another look at that Borek? I may not have much time next days. I think you can simplify by ignoring the first and third phosphoric acid dissociations. Even if you couldn't you would worry if you couldn't solve the same problem for some other substance with just one pK about 2 units below that of NH_{4}^{+}, so how to do that? I think you can think you have your 2/3 mole of phosphate buffer at pH = pK = 7.21 and to it are adding 1/3 mole of H_{2}PO_{4}^{-} and 1/3 mole NH_{4}^{+}. This added H_{2}PO_{4}^{-} stays in that form on the basis its dissociable proton 'has nowhere to go'. The ammonia is already protonated and if it protonates a HPO_{4}^{2-} the result is no change! So the ratio [H_{2}PO_{4}^{-}]/[HPO_{4}^{2-}] is (1/3 + 1/3)/(1/3) = 2, which corresponds to a pH close to 6.9 which sounds to me about right - the ammonium biphosphate solution is somewhat acid (I think pH is mean of that of NH_{4}^{+} and the first pK of H_{3}PO_{4} -> about 5.5); you are adding this weakly buffered solution to the maximally buffered K phosphate. When I do a calculation with all the equations I do get a result close to that. I have a vague inkling but not got to the bottom of the fact I get a quadratic and its other root is positive but unphysical. Edit: I suppose that's OK. 'Unphysical' meant there was a concentration that was higher than it can be, but that just means by conservation that another one is negative. You must have just one physical solution but if equation degree is even you must get another real root which should be negative to make it unphysical. Maybe sometimes (often? always? negative real solutions with odd degree equations also). It is all quite hard to think about.