A thought experiment to test the general validity of available mash pH software

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
This is exactly why I'm hesitant to make changes. The regression testing needed to confirm the accuracy of predicted to real-world pH values is significant (think years).
I would be happy with just knowing the rms error delivered by one spreadsheet as compared to another.

Also keep in mind that if you do something based on what I have posted in this thread (augmented with places for additional grains) you get a detailed look at where all the protons are going. You can take the data from an old brew and plug it into your spreadsheet and this one and see where they differ and what may be driving the error you got. For example you may see in a brew whose actual pH was appreciably lower than predicted that one malt was a particularly strong proton absorber and re-examine your model for that malt. Or you may see that your program requires more acid for water of a given alkalinity than this one does and focus on how you handle alkalinity calculations.

My first thought was that the main value of the spreadsheet offered here was for teaching but it has since occurred to me that it has potential value as a spreadsheet developer's diagnostic tool as well.
 
Here is my Riff (pun totally intended) on Riffe's MpH v.3.0 spreadsheet. It is the fully modified version that I use. I had previously redacted some of the content because it didn't really apply to the conversation.

https://drive.google.com/open?id=1L_CopjqwAgsw173zG2uc_rnjyNt__zyI

A quick summary:

1.) The bulk of this sheet is a straight lift and remodel of D.M. Riffe's MpH sheet
2.) ∑ pH/kg serves as the pHDI value
3.) ∑ f * A serves as the first co-efficient (a)
4.) The sheet is all metric (sorry ladies and gents)
5.) pH/RA slope is selectable between Riffe's calculation and the 0.17 constant
6.) Source type is selectable between Tap and Distilled
7.) Source dilution
8.) RA Type is selectable between Troester and Kolbach
9.) CaCl is selectable between Dihydrate, Anhydrous, and Liquid
10.) Antioxidants are supported
11.) Biological Acidification via Sauergut is supported as low acid % lactic
12.) Acid additions are extrapolated to include Kettle and Knockout additions

EDIT: New link. Forgot to add source dilution in.
 
Last edited:
it turns out that my soon to be released version 1.60 upgrade's repair of the downward mash pH shift attributed to the addition of minerals is a tremendously bigger fix than I initially anticipated. Before the fix the Mash Made Easy program was committing a major error along the lines of what Bru'n Water does with the water to grist ratio and acidification, only with respect to the minerals added to strike water and the water to minerals ratio instead. This has now been fixed. Now changes in strike water volume have no effect upon the downward pH shift that is to be attributed solely to the mineralization of the strike water. Instead of keying on the ppm's for ca++ and mg++, which go down as strike water volume increases, or visa-versa, my program is now keying upon the mEq values of the added minerals, which do not change as the water to grist ratio is increased or decreased, and mineral ppm's go down and up as a result. I must thank you again A.J.

Looking at this another way, it is an extension of my thought experiment. Just as acids/bases which are added to the mash water react predominantly with the grist, and the strike water (when DI) plays little part in it, so do the added minerals. The volume of the water carrier is also effectively irrelevant to the reaction of the weight of the added minerals with the weight of the grist. I hope I'm seeing this aspect of the mash correctly, as I inferred it from A.J.'s way of thinking in terms of mEq's instead of ppm's.
 
Last edited:
it turns out that my soon to be released version 1.60 upgrade's repair of the downward mash pH shift attributed to the addition of minerals is a tremendously bigger fix than I initially anticipated. Before the fix the Mash Made Easy program was committing a major error along the lines of what Bru'n Water does with the water to grist ratio and acidification, only with respect to the minerals added to strike water and the water to minerals ratio instead. This has now been fixed. Now changes in strike water volume have no effect upon the downward pH shift that is to be attributed solely to the mineralization of the strike water. Instead of keying on the ppm's for ca++ and mg++, which go down as strike water volume increases, or visa-versa, my program is now keying upon the mEq values of the added minerals, which do not change as the water to grist ratio is increased or decreased, and mineral ppm's go down and up as a result. I must thank you again A.J.

Looking at this another way, it is an extension of my thought experiment. Just as acids/bases which are added to the mash water react predominantly with the grist, and the strike water (when DI) plays little part in it, so do the added minerals. The volume of the water carrier is also effectively irrelevant to the reaction of the weight of the added minerals with the weight of the grist. I hope I'm seeing this aspect of the mash correctly, as I inferred it from A.J.'s way of thinking in terms of mEq's instead of ppm's.

I'm not following: are you saying that for a fixed amount of malt and fixed amount of Ca or Mg mineral that varying the volume which they are put in makes no difference in their ability to shift pH down?

That doesn't sound correct to me.
 
I'm not following: are you saying that for a fixed amount of malt and fixed amount of Ca or Mg mineral that varying the volume which they are put in makes no difference in their ability to shift pH down?

That doesn't sound correct to me.

Yes, this is the gist of what I'm saying. I must now defer to A.J. yet again, to see if this (my new line of reasoning with regard to calcium and magnesium mineralization) is correct. If it is, it may send an entirely new set of shock-waves through many of the existing mash pH software programs.
 
Last edited:
....My first thought was that the main value of the spreadsheet offered here was for teaching but it has since occurred to me that it has potential value as a spreadsheet developer's diagnostic tool as well.
Something I would jump at the chance of using. If only I understood how to use it (sigh).
 
I can now report that the Kaiser Water Calculator does not alter its downward mash pH shift with regard to fixed mineralization quantities and variable mash water quantities. Mash Made Easy now joins this calculator in this regard.

EZ Water fails miserably here. I was able to hit a mash pH of 5.4 by adding some minerals and then bumping the strike water up to about 220 gallons for a fixed grist and fixed minerals weight. The mash pH fell with each incremental bumping up of the strike water volume, in conjunction with rapidly falling mineral ppm's.

Other calculators have not been put to the test in this regard. Perhaps I've picked on them a bit much already. Others are however free to pick up this ball and run with it.
 
Last edited:
I can now report that the Kaiser Water Calculator does not alter its downward mash pH shift with regard to fixed mineralization quantities and variable mash water quantities. Mash Made Easy now joins this calculator in this regard.

EZ Water fails miserably here. I was able to hit a mash pH of 5.4 by adding some minerals and then bumping the strike water up to about 220 gallons for a fixed grist and fixed minerals weight. The mash pH fell with each incremental bumping up of the strike water volume.

Other calculators have not been put to the test in this regard. Perhaps I've picked on them a bit much already. Others are however free to pick up this ball and run with it.

I just find it incredibly hard to believe that, all else being equal, that X grams of a mineral has it's effect on pH unaltered by radically changing the volume it's put into.

I'm more than willing to hear out any logical explanation for it but it defies reason for me. Then again, I've never claimed to have been the smartest guy in the room or the quickest pupil.
 
The MPH calculator works in reverse of what I saw for EZ Water. For a fixed quantity of added minerals and a fixed grist, the predicted mash pH falls as the strike water volume decreases. It seems to be almost an exponential fall.
 
I just find it incredibly hard to believe that, all else being equal, that X grams of a mineral has it's effect on pH unaltered by radically changing the volume it's put into.

I'm more than willing to hear out any logical explanation for it but it defies reason for me. Then again, I've never claimed to have been the smartest guy in the room or the quickest pupil.
Not really surprised to hear this though. If RO or DI water has no notable buffering in it then why would a larger volume of water with no notable buffering in it be any different. No need to split hairs or molecules here. Just using everyday man speak.
 
The MPH calculator works in reverse of what I saw for EZ Water. For a fixed quantity of added minerals and a fixed grist, the predicted mash pH falls as the strike water volume decreases. It seems to be almost an exponential fall.

Which is why i'm so confused about your theory. The concentration of the mineral will increase as you decrease the volume (ppm = mg/l, i.e. less volume equals more mg) and therefore the mEq/l will increase and reduce the pH more.

I guess maybe i'm just being a little dense but i can't see how you uncouple this relationship.
 
This just dawned upon me. For those who think I'm merely picking on other programmers software in this thread, a careful read of this thread will indicate that I have done a fair degree of bashing my own 'MME' program on multiple occasions now as well. I have also been fixing MME as this thread progresses.
 
Which is why i'm so confused about your theory. The concentration of the mineral will increase as you decrease the volume (ppm = mg/l, i.e. less volume equals more mg) and therefore the mEq/l will increase and reduce the pH more.

I guess maybe i'm just being a little dense but i can't see how you uncouple this relationship.

Chemical reactions occur mEq for mEq (or mole for mole, with due respect paid to valences), do they not? Overall mEq's are one thing and mEq's/L are another, no? Just asking....
 
Chemical reactions occur mEq for mEq (or mole for mole, with due respect paid to valences), do they not? Overall mEq's are one thing and mEq's/L are another, no? Just asking....

That's where my knowledge ends. Remember, I'm an engineer, not a chemist. I know how to apply things in the real world, not necessarily how they work theoretically.

In other words, applied science is my thing.

Let's take my modded version of MpH as an example:

Grist pH = ∑ pH/kg - (0.0337 * ∑ f * A) (volume independant)

Mixed Water pH = Grist pH - (0.17 * RA (mEq/l)

So we'd have to decouple volume from mEq at this point.

Again, i'm not sure how that's done.
 
Last edited:
My take on this question is that malt phosphate reacts with calcium ion to precipitate (mostly) apatite by

10Ca++ + 6H2PO4- + 2H2O ---> Ca10(PO4)6(OH)2 + 14H+

This says that as long as the mash is thick enough to keep phosphate in excess (which, given that malt contains about 2% of it and assuming that a good part of that is available as inorganic phosphate, it ought to be) the amount of 'acid' produced depends only on the total amount of calcium in the water - not whether it is present at 1 mEq/L or 10. The stoichimetry of this equation says that 14 mEq of H+ are produced by 20 mEq of calcium i.e. H+ = [Ca]/1.428. But Kohlbach observed that at knockout [Ca]/3.5 mEq of alkalinity was neutralized meaning that in actual worts (or, in particular the ones he worked with which I assume were for typical German lagers) [Ca meq]/3.5 mEq of H+ was released. One thing is clear and that is that if x pounds of malt are mashed with y L of water of calcium hardness z mEq/L and also with 2*y L of water at z/2 mEq per liter (the amount of calcium to which the malt is exposed is thus the same) then the initial ion product [HPO4-]^6[Ca++]^10 is going to be almost 5 orders of magnitude smaller than it would be in the nominal case but is that enough to inhibit precipitation. In Kohlbch's paper he doesn't say anything about the range of hardness levels over which [Ca++]/3.5 applies. While common sense dictates that in the limit as the mash becomes infinitely dilute precipitation will not take place. The failure of Kohlbach to mention this suggests that a calcium addition can be handles extensively i.e. independent of the volume of water implying that if you have a volume, L, of water with given alkalinity and calcium hardness [Ca++] mEq/L that L*[Ca++]/3.5 mEq/L of alkalinity will be neutralized. If L liters of DI water are now added I assume that L*[Ca++]/3.5 mEq (i.e. the same amount) of alkalinity will be added even though the alkalinity of the 2 L of water mixed is now alk/2 and the hardness [Ca++]/2
 
A.J., I believe you just supported my outlook, but can you please bring this down to earth a tad for us commoner plebes? Is the Kaiser Water Calculator correct, or is EZ Water, or MPH? If Kaiser is wrong I will take Mash Made Easy back to an earlier outlook on this.
 
This may solve your confusion. How can less volume equal more mg of added minerals, when only a fixed number of mg of said minerals were added to start with?

As a consequence of doing the calculation in excel, I have to take the gram inputs for minerals and divide them by the volume in which they are dissolved in to get the concentration in mg/l.

I guess if what you propose is correct, the logical place to uncouple would be when I calculate the normality of Ca, Mg, and HCO3.
 
As a consequence of doing the calculation in excel, I have to take the gram inputs for minerals and divide them by the volume in which they are dissolved in to get the concentration in mg/l.

I guess if what you propose is correct, the logical place to uncouple would be when I calculate the normality of Ca, Mg, and HCO3.
Where mg/l is the same as ppm. Lactic acid additions are handled differently relatative to mash thickness than acid from salts like calcium.
 
Where mg/l is the same as ppm. Lactic acid additions are handled differently relatative to mash thickness than acid from salts like calcium.

My internal logic machine can’t comprehend that 1 gram of CaCl gives the same pH shift in 20 liters as it does in 100 liters.
 
Where mg/l is the same as ppm. Lactic acid additions are handled differently relatative to mash thickness than acid from salts like calcium.

Not if A.J. confirms my new thought experiments contention (as I tentatively believe he already has, in his stating that it matters little if Ca++ is present at a concentration of 1 mEq/L or 10). Did I say this one would rock the boat just as much or more than my original thought experiment?

Mash Made Easy version 1.60 is now ready to be released in both standard and metric, pending A.J.'s simplified confirmation of this matter.
 
Last edited:
Which is why i'm so confused about your theory. The concentration of the mineral will increase as you decrease the volume (ppm = mg/l, i.e. less volume equals more mg) and therefore the mEq/l will increase and reduce the pH more.

I guess maybe i'm just being a little dense but i can't see how you uncouple this relationship.
I think I'm leaning your direction also (although I am also not a chemist). If we simplify this, if I add 5ml of lactic to a liter of water, I am going to get a much different pH than I would if I added it to 10 liters.
 
Not if A.J. confirms my new thought experiments contention (as I tentatively believe he already has, in his stating that it matters little if Ca++ is present at a concentration of 1 mEq/L or 10). Did I say this one would rock the boat just as much or more than my original thought experiment?

Mash Made Easy version 1.60 is now ready to be released in both standard and metric, pending A.J.'s simplified confirmation of this matter.
@Silver_Is_Money I'm confused didn't you post earlier today that would take a major coding effort to implement the changes? Unfortunately I haven't had time to absorb half of what's been posted today.
 
If I am right in thinking that x mEq of calcium produce x/3.5 mEq of hydrogen ions then adding 3.5*x mEq of calcium would be like adding x mEq of acid regardless of mash thickness. Thus the discussions earlier in this thread should help. If we add an mEq of acid to a thick mash most of the protons go to the malt and but a few to the water. If we add it to a mash half as thick (twice the water) most of protons again go to the malt but twice as many now go to the water and so there is a slight increase in pH.

You probably knew this was coming. I put calcium into the spreadsheet as an item equal to L*[Ca++]/f where f is the Kohlbach factor. I used 3.5 here for maximum effect but given that we know that Kohlbach was referring to knockout the value for the mash tun reaction must be > 3.5. Nevertheless:
Untitled11.jpeg

Untitled12.jpeg


In Column B we have 12.5 lbs of malt mashed with 10 gal DI water acidified to pH 5.4. In Column C we have added enough calcium to set the calcium hardness of the 10 gal to 1 mEq/L. In Column D we have mashed with 20 gal DI water to which we have added the same amount of calcium such that the hardness of the 20 gal is 0.5 mEq/L. In Row 14 we see that the pH shifts from 5.4 (Col. B) to 5.36239 (Col C) i.e. downward by 0.0376 when 37.85 mEq Calcium is added to 10 gal of water. Col D shows a down ward shift of 0.0370 (very slightly less) to 5.36295 when that same amount of calcium is added to 20 L DI water.

I have to say here that I believe the calcium shift to be a very iffy thing derived as it is from Kohlbach's observation under what I am assuming are conditions restricted to those typical of pre-WWII German lager brewing practices. Given that only part of the reaction takes place in the mash tun and he is talking about knockout we know that the H+ ion contribution in the mash tun has to be less. I usually use 7 - 10 for the Kohbach factor but have no feeling as to whether that is right or not.
 
I think I'm leaning your direction also (although I am also not a chemist). If we simplify this, if I add 5ml of lactic to a liter of water, I am going to get a much different pH than I would if I added it to 10 liters.
Yes you are - if the water is pure but in the case of a mash it isn't. It contains a base much stronger that water - malt. What would happen if you dissolved a pound of lye in 5 gal of water and added 5 mL of lactic acid and then repeated the experiment with a pound of lye dissolved in 10 gal of water?

I wonder if this misconception is somehow related to the Bru'n water problem.
 
In Column B we have 12.5 lbs of malt mashed with 10 gal DI water acidified to pH 5.4. In Column C we have added enough calcium to set the calcium hardness of the 10 gal to 1 mEq/L. In Column D we have mashed with 20 gal DI water to which we have added the same amount of calcium such that the hardness of the 20 gal is 0.5 mEq/L. In Row 14 we see that the pH shifts from 5.4 (Col. B) to 5.36239 (Col C) i.e. downward by 0.0376 when 37.85 mEq Calcium is added to 10 gal of water. Col D shows a down ward shift of 0.0370 (very slightly less) to 5.36295 when that same amount of calcium is added to 20 L DI water.

I have to say here that I believe the calcium shift to be a very iffy thing derived as it is from Kohlbach's observation under what I am assuming are conditions restricted to those typical of pre-WWII German lager brewing practices. Given that only part of the reaction takes place in the mash tun and he is talking about knockout we know that the H+ ion contribution in the mash tun has to be less. I usually use 7 - 10 for the Kohbach factor but have no feeling as to whether that is right or not.

A.J., in row 77 both columns B and C result in very small 'Q Total' numbers, as is the goal, correct? And in both cases you ended up acidifying with the exact same quantity of Lactic Acid. As this is the case, then for the small differences in Total Q seen in row 77 for columns B and C, in reality once again we have a situation where the DI water to grist ratio is not changing the pH shifting effect by very much at all, only this time with regard to the fixed quantity of added calcium mineralization and the variable DI mash water quantity. Do you see this essentially as I do here? If so, then (just as I have done for my pending Mash Made Easy version 1.60) most others will need to alter their mash pH predicting software accordingly, but the Kaiser Water Calculator is vindicated.
 
Last edited:
Maybe we can fix that. How many rows down can you go before you hit the wall?
AJ two things come to mind. Your latest spreadsheet example has additional rows that were not included in your previous spreadsheet post. Solver is something I learned how to use. I am able to replicate your previous spreadsheet results now.
 
Last edited:
AJ two things come to mind. Your latest spreadsheet example has additional rows that were not included in your previous spreadsheet post. Solver is something I learned how to use. I am able to replicate your previous spreadsheet results now.
Excellent.
I'm assuming the moderators will tell me if I'm hogging too many resources but here are the columns for the latest version of the spreadsheet which now includes an input for calcium. Let me know if you hit another snag.
Column A: Labels
Malt lbs
Water, gal
alkalinity, ppm
Water pH, pHs
Alk End point, pHe
Added Other Acid mEq
Added Lactic, mL
Lactic % w/w
Added NaHCO3, gm
Calcium hardness mEq/L
Kohlbach factor


pHz

pHDi
a
b
c

Malt kg
Wter L
alk, mEq/L

∆Qmalt

r1e
r2e
f0e
f1e
f2e
QCe

r1Z
r2Z
f0Z
f1Z
f2Z
QCZ

r1s
r2s
f0s
f1s
f2s
QCs

r1Lz
f0Lz
f1Lz
QLz
Lactic density g/mL
Lactic mmol/mL
Lactic Normality mEq/ml

Qwe
Qwz
Qws

Carbo Alk
Ct

∆Qwater/L
∆Qalk/L
∆Qmalt/kg
∆Qlac/cc
∆QNaHCO3 mEq/mmol
∆QNaHCO3 mEq/gm

∆Qwater
∆Qalk
∆Qmalt
Added Other Acid
∆Q Lactic
∆Q NaHCO3
∆Q Calcium
∆Q Total

Column B: The works
12.5
10
=0.0316224*50
7
4.5
0
4.36258610330845
88
0
0
3.5


5.4

5.6227
-40.69
14.821
-10.008

=0.457*B1
=3.785*B2
=B3/50

=B17*(B14-B16)+B18*(B14-B16)^2+B19*(B14-B16)^3

=10^(B5-6.38)
=10^(B5-10.38)
=1/(1 +B27 + B27*B28)
=B27*B29
=B30*B28
=-B30-2*B31

=10^(B14-6.38)
=10^(B14-10.38)
=1/(1 +B34 + B34*B35)
=B34*B36
=B37*B35
=-B37-2*B38

=10^(B4-6.38)
=10^(B4-10.38)
=1/(1 +B41 + B41*B42)
=B41*B43
=B44*B42
=-B44-2*B45

=10^(B14-3.856862)
=1/(1 +B48 )
=B48*B49
=-B50
=(-0.0000032247*B8 + 0.0026771)*B8 +0.99464
=1000*B52/90.08
=B53*B50

=1000*(10^-B5-10^(B5-14))
=1000*(10^-B14-10^(B14-14))
=1000*(10^-B4-10^(B4-14))

= B23 -(B56-B58)
=B60/(B32-B46)

=(B57-B58)
=B61*(B39-B46)
=B25
=-B54
=(B39 +1)
=1000*B67/84.01

=B22*B63
=B22*B64
=B21*B65
=-B6
=B7*B66
=B9*B68
=-B22*B10/B11
=SUM(B70:B76)
 
I needed another spreadsheet like a second crack you know where. I guess I need to throw one of these together now and pick up my marbles off the ground.

I’ll have to rectify this stuff in my own sheet but first I want to run through some scenarios and see what the pH deltas are when varying the volumes in a normal range.
 
A.J., in row 77 both columns B and C result in very small 'Q Total' numbers, as is the goal, correct? And in both cases you ended up acidifying with the exact same quantity of Lactic Acid.
Yes, the goal is always to find the value of the sought after quantity which drives the sum of the ∆Q's as close to 0 as you can get it because in the real world the sum of the ∆Q's is 0. Now notice that ∑∆Q is larger in Col D than in the other two columns. But it is small enough. Solver is iterative. It will stop if it gets close enough to target any time but it will also stop after a certain number of iterations. If you arrive at a case with ∑∆Q larger than you are happy with just run it again. It then does another set of iterations starting where it left off last time and depending on the nature of the problem will usually find a solution resulting in a smaller residual.

The lactic acid is exactly the same in all three cases. The goal was to show where the pH falls with 12.5 lbs malt, 0 or 37.85 mEq Ca++, 4.362586103 mL lactic acid and 10 or 20 gal DI water.

As this is the case, then for the small differences in Total Q seen in row 77 for columns B and C, in reality once again we have a situation where the DI water to grist ratio is not changing the pH shifting effect by very much at all, only this time with regard to the fixed quantity of added calcium mineralization and the variable DI mash water quantity. Do you see this essentially as I do here?
Yes

If so, then (just as I have done for my pending Mash Made Easy version 1.60) most others will need to alter their mash pH predicting software accordingly, but the Kaiser Water Calculator is vindicated.
Are you noticing a trend here? Kai knows what he is doing. Too bad he doesn't contribute here any more. He used to.
 
Are you talking about the Kaiser Water excel spreadsheet? I still have a copy in my files and I’m going to review tonight.
 
AJ two things come to mind. Your latest spreadsheet example has additional rows that were not included in your previous spreadsheet post. Solver is something I learned how to use. I am able to replicate your previous spreadsheet results now.
Hi @ajdelange how did you get the pHz values to change? Did you use solver for that too? Using your latest version with 0, 1.0 and 0.5 mEq/L of calcium hardness in columns B, C and D I can see the mL of lactic acid changes. But the pHz values are entered.

aj-3.jpg
 
Last edited:
A.J., I copied and used your latest spreadsheet to confirm that mineralization's effect upon the quantity of acid required to hit a mash pH of 5.4 does not change much when going from 1 mEq/L of Ca++ in 10 gallons to 0.5 mEq/L in 20 gallons, and to get near zero 'delta Q Total' in row 77 required that I add 3.53 mL of 88% lactic acid to the 10 gallon mash, and 3.542 mL to the 20 gallon mash. Not much difference, confirming that a doubling of the mash water does not change much with respect to the impact of a fixed quantity of minerals added to the mash.

3.542/3.53 = 1.0034
 
Yes! Version 1.58

I’m a trust but verify kind of guy. It’s the former nuclear power plant engineer me.

I see some volume based relationships for pH shift in the detailed calculations so I’ll have to square that before I’m on board with you guys.

I’d also like to play with AJs sheet and mine as well before I go changing my modded Riffe calcs around. I don’t doubt what you are saying but I have not had the time to crunch the numbers myself yet.
 
RPIScotty: I didn't use any of the inner workings of the Kaiser Water Calculator for Mash Made Easy.

PM me if you want to discuss my solution with regard to mineralization and its impact upon downward mash pH shift, but you are also welcome to download a copy of my new Mash Made Easy version 1.60 first. I just got it up and running on my website.
 
Back
Top