Mash pH prediction and control

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.

ajdelange

Supporting Member
HBT Supporter
Joined
Aug 5, 2010
Messages
11,959
Reaction score
2,747
Location
McLean/Ogden
As the publishers deadline for the new Water book neared it was realized that a better explanation was needed for the mechanisms that determine and can be used to control mash pH. The material that starts at around p82 resulted and, reading back over it, it does a darn good job. Nevertheless I've had time to think about this more at leisure and come up with the concept of keeping track of 'Proton Deficit' as a convenient way of talking about and predicting what goes on in a mash. If you are a chemist you will know that this is nothing new but just a new twist on 'Proton Condition'. At John's suggestion I presented this idea to the MBAA national conference in Austin compressed into 20 min (John had to work with a worse compression ratio for his talk) and again (in an hour) at the District Mid Atlantic Meeting in Frederick, MD, last weekend. When I got a request for the slides from that later talk it occurred to me that I should make them available to interested readers of HBT as well so this post is to tell you where to find them and that is:
http://www.wetnewf.org/pdfs/Brewing_articles/MBAA_FREDERIC.pptx

I had ginned up a spreadsheet to feed John actual numbers while he was writing like mad and I've dressed that up a bit so that if you really want to see how this works you should play around with that some. It is at:
http://www.wetnewf.org/pdfs/Brewing_articles/MashpH.xlsx
If you do download it and it asks about links to other spreadsheets just click 'ignore' and sail on.

The spreadsheet lets you determine mash pH from a set of malt parameters, water parameters and data on added acids (including phosphoric) and bases. It makes no approximations (other than that of ideally dilute solutions) with regard to the relationships between alkalinity, pH and carbonic acid system proton deficit and it handles the phosphoric acid system in the same way. If you have complete malt data, obtained as is described in the slides, you should get a pretty good prediction (but it is still only a model). Unless you are willing to do a lot of work, you will not have such data but may still like to try this out. For those of you that do I have included Kai Troester's data (which is also in the book) and calculated an approximation to the first malt coefficient (a malt is completely described by its distilled water mash pH and 3 coefficients) which you can stick into the malt parameters section, setting the second and third coefficients to 0. Troester's data was taken without allowance for pH drift with time nor for nonlinearity of the titration curves. The curves are not linear but the deviations from linearity are modest in the pH ranges of interest. I have also included fits from which you can calculate DI mash pH and the first coefficient from the EBC color of the malt. I believe this is what some of the popular spreadheets and calculators do. This is pretty iffy as the fits aren't that good but even this should be better than no data at all.

Because the malts, the carbonic acid system and the phosphate system are non linear closed form solution is difficult so this spreadsheet requires that you put in a pH guess and observe the Total Proton Deficit that guess implies. You then revise your guess in an intelligent fashion (an algorithm is given in the slides) or let the Excel Solver do it for you until you reach 0 proton deficit. The pH which gives you 0 is the estimated pH of the mash. If you are using Excel and don't know what the Solver is you should invest the small amount of time it takes to install it and learn to use it. It is a very powerful tool. OTOH manually guessing and looking at what happens to the proton deficits for each guess should be great for giving you an intuitive feel for where the protons come from and whence they go.

If you want to set mash pH to a given level enter that into the pH field and then adjust water alkalinity, dark malt additions, acid additions... until the total proton deficit is zeroed.

This all seems very simple to me but then I've been close to it for a long time and it wasn't so simple at the outset. I'd be interested to hear what you guys think.
 
AJ, this is way over my head, but giving it a go to see if I can understand the principle. I read the PPT, and I think I got the gyst on balancing proton deficits.

A) When you ask for water volumes, I assume you are asking for total volume including mash and sparge water. Your example appears to be for a 20 gallon batch?

B) I realize this is elementary math, but having a problem converting from mg/l to mEq (should that be mEq/L?) for the acid/base additions. I assume I am going to have to look up molar weights and charges to calculate from mg/l correct? (mg/l x mol/g = mmol/l, mmol/l x (num of charges) = mEq/l) Should I then multiply mEq/l x (total volume water in liters?) // confused.

C) We are pre-estimating the liquid acid additions, but in mmols (weight) and not volume concentration? or leaving this at Zero until executing the solver?

D) The solver is building a predictive array that will be used as curves to balance the proton deficit to 0?

I am inputting a recipe I brewed just last week, using Bru'n to plan, and hit the expected mash pH right on. Fortunately - it uses some of the listed Kai malts - I did sub the numbers for Cara-Pils with Cara-Aroma, assuming they may be close.
 
AJ, this is way over my head, but giving it a go to see if I can understand the principle. I read the PPT, and I think I got the gyst on balancing proton deficits.
Then it isn't over your head! It may be new, unfamiliar and uncomfortable and it doesn't have all the niceties like radio buttons to let you select whether you want metric or english units... It's not for beginners, though.

A) When you ask for water volumes, I assume you are asking for total volume including mash and sparge water. Your example appears to be for a 20 gallon batch?
Just the water in the mash. We are predicting mash pH here and need to know how many protons from grains, added acids are needed to balance the deficit of the mash water.


B) I realize this is elementary math, but having a problem converting from mg/l to mEq (should that be mEq/L?) for the acid/base additions.
This is the total mEq of acid added to the mash (most likely added to the water). Thus, if you add 100 mL of 1 N acid you have added 100 mEq.



I assume I am going to have to look up molar weights and charges to calculate from mg/l correct? (mg/l x mol/g = mmol/l, mmol/l x (num of charges) = mEq/l) Should I then multiply mEq/l x (total volume water in liters?) // confused.

The easiest way to do it is to determine the normality of the acid you are adding. Then it is a simple matter of mEq = mL*Normality. If you are using lactic acid, for example, then you would have to figure out the grams of the acid per liter of the solution and divide by the molecular weight to get the mol/L and multiply that by the charge (which is 1) to get the Eq/L which is the normality. An 88% lactic acid solution has density 1.206 g/cc so a liter weighs 1206 grams of which 0.88*1206 = 1061 grams are lactic acid. The molecular weight is 90.08 so a liter of the acid contains 1061/90.08 = 11.78 mol which is 11.78 equivalents. Thus 88% lactic acid is 11.78 N and 1 mL yields 11.78 mEq.

For phosphoric you put in the number of mmols and the spreadsheet figures out the mEq for you based on the pH.


C) We are pre-estimating the liquid acid additions, but in mmols (weight) and not volume concentration?
If you know you are going to add acid, then you put in a number. If you want to determine how much acid to add then you leave that 0, set pH to the target and then ask the Solver to zero PD (proton deficit) by varying the acid number.

As I said in the previous post I am guessing that searching manually while watching the total proton deficit and the proton deficits of the individual components will give you great insight as to what happens when you vary things in a mash.


D) The solver is building a predictive array that will be used as curves to balance the proton deficit to 0?
I don't know the exact algorithm the solver uses (and there is a choice) but I expect they are looking at the rate of change of PD with respect to the parameter being varied and doing a 'gradient search' for the minumum PD based on that.

I am inputting a recipe I brewed just last week, using Bru'n to plan, and hit the expected mash pH right on. Fortunately - it uses some of the listed Kai malts - I did sub the numbers for Cara-Pils with Cara-Aroma, assuming they may be close.

I'm not sure exactly how Bru'n comes up with DI pH and slope and I'm not even sure it is based on Kai's data but I think it is. Be interesting to see how this and Bru'n compare. Note that I am not claiming that this method can be any better (and the other spreadsheets have to be doing something very like this in order to get an answer) than what anybody else does unless you have a full set of malt coefficients which we don't when using Kai's data.
 
Well AJ - I got it working and I think I understand by watching the values how it functions. Of course, I am googling formulae for a good part of this...

It seems there is some disagreement with Bru'n water, at least in the case of RO/DI source water, but it could also be my poor math skills.

Input the following:
30.81 liters mash water - including a small mash out infusion
6.4 pH (I assume before salt additions - correct?)
RA of 0.26, which converts to 13 and matches Bru'n
0 Ca++ / RO
0 Mg++ /RO

8.28 kg Pilsener
0.54 kg Biscuit
0.54 kg Vienna
0.81 kg Cara-pils (Used the Aromatic numbers from the chart)

no salt or acid additions added

Solver yields an estimated target pH of 5.489, which is somewhat close to the 5.43 in Bru'n estimate with my mash salt additions (listed below)

Adding in 50 mmol of Phosphoric, brings the mash pH to 5.383, and the inverse if I add in units of base, pH rises... so it seems to be working as advertised.

In my brew last week with this recipe, I added a total of 13.8 grams CaSO4, 3.7 grams MgSO4, and 3.3 grams CaCl2 into the mash, no liquid acid and measured between 5.38 and 5.42 at 4 points throughout the mash with a calibrated meter. The prediction was 5.42, and 5.42 went into the kettle.

I must have entered something incorrectly into your spreadsheet, probably a conversion error on my part. You are solving backward in a sense, so I would expect some differences from Bru'n. I will check on the delta without the salt additions.
 
Well AJ - I got it working and I think I understand by watching the values how it functions. Of course, I am googling formulae for a good part of this...
All the formulas you should need for the carbonic (of which there is none at this point) are on the slides. Same for phosphate and there is none of that here (i.e. the example you are working with). You should be able to relate the formulas on the slides to the formulas in the spreadsheet especially those for r1, r2... and f1, f2...

It seems there is some disagreement with Bru'n water, at least in the case of RO/DI source water, but it could also be my poor math skills.
That is to be expected. In the example you are using my non linear models for two of the malts. I'm not sure exactly what Bru'n does bud I am pretty sure the malt titration model is linear and is based on measurements that don't account for time variation.

Input the following:
30.81 liters mash water - including a small mash out infusion
6.4 pH (I assume before salt additions - correct?)
RA of 0.26, which converts to 13 and matches Bru'n
0 Ca++ / RO
0 Mg++ /RO

8.28 kg Pilsener
0.54 kg Biscuit
0.54 kg Vienna
0.81 kg Cara-pils (Used the Aromatic numbers from the chart)

no salt or acid additions added

Solver yields an estimated target pH of 5.489, which is somewhat close to the 5.43 in Bru'n estimate with my mash salt additions (listed below)
I get 5.491 and I think the difference between our answers is that even totally pure water has finite alkalinity of 0.03162 mEq/L with respect to pH 5.4. This is calculated for you in J5 and should be entered in C6. If I put 0 in C6 I get the same thing you do exactly.



In my brew last week with this recipe, I added a total of 13.8 grams CaSO4, 3.7 grams MgSO4, and 3.3 grams CaCl2 into the mash, no liquid acid and measured between 5.38 and 5.42 at 4 points throughout the mash with a calibrated meter. The prediction was 5.42, and 5.42 went into the kettle.
If I put those calcium and magnesium numbers in I get a predicted pH of 5.36 which is gratifyingly close to 5.38 and pretty good re 5.42. Remember that you didn't use the Pilsner malt I measured and you didn't use the Cara I measured and the other malts as modeled by Bru'n water were not the other specialty malts you used either.


I must have entered something incorrectly into your spreadsheet, probably a conversion error on my part. You are solving backward in a sense, so I would expect some differences from Bru'n. I will check on the delta without the salt additions.

Doesn't look like it unless you got the calcium and magnesium additions wrong.
 
Brilliant work, AJ. It is food for thought.

It has long bothered me that Kai's titrations to determine malt acidity targeted a pH of 5.7. The new work that you present in the powerpoint targets 5.3. With the typical range of mash pH targets falling between 5.2 and 5.6, I'm curious why you didn't target the median value of 5.4? I'm not sure that this matters much, but I found it odd. Given that Bru'n Water is largely based on the malt acidity results that Kai presented, the pH target apparently doesn't really matter too much.

Knowing what I know of the engine in Bru'n Water, the methodology you present is quite similar. There are surfeits and deficits of acidity (aka: protons) that are assessed. Bru'n Water takes that net acidity (or lack of it) and uses it to predict mash pH.

I like the specificity of the method you present. It moves from malt type and color estimates of acidity to a malt-specific acidity. That should provide an improvement in accuracy. The problem then becomes: obtaining those malt-specific acidities. I suppose if maltsters start providing those values, this would be a definite step up. However in the absence of that data, we are left in a situation where GIGO might still affect the results.
 
It has long bothered me that Kai's titrations to determine malt acidity targeted a pH of 5.7.

We have to remember that Kai was the pioneer here. As such he didn't know everything we know now. This work really builds upon his and that's the way things are supposed to work AFAIK. He understood the concept of buffering capacity or proton deficit or whatever we want to call it without perhaps appreciating all the implications and nuances. I'm not sure why he picked 5.7 as the end point of his titrations. I might guess that it is because that is the DI pH of a typical base malt but that is only a guess. There would be nothing wrong with titrating to pH 5.7 if the titration curves were linear. They aren't but the non linearities are not that great as my curves show. The fact that models based on Kai's data come as close as they do is further testament to this. Briess tried to do something similar to what Kai did but chose to titrate to 7 for whatever reason (because it's water's neutral point?) which really stretches the linearity assumption but John used that assumption to 'convert' Briess's proton deficits to 5.7 and the answers he got were not that wild.

The new work that you present in the powerpoint targets 5.3. With the typical range of mash pH targets falling between 5.2 and 5.6, I'm curious why you didn't target the median value of 5.4?
I'm a little confused as to how you might have concluded that. The titrations I did were based on spanning the range of possible mash pH's including, of course, the DI mash pH because that one is a freebie (no acid or base addition needed) and because I'm doing Taylor series expansion about the DI pH).

Several of the charts illustrate a target pH (pHz) of 5.4. Could this be what you are referring to? This was a convenient value at which to demonstrate how to calculate the charge on carbo since it is -0.1 mEq/mmol at pH 5.4 and having used 5.4 in the first example I carried it through to the malt curves. But note that this is not the same as the end point of the 'titrations' I did and thus not comparable to the 5.7 or 7 values reported in the Troester and Bies work. There is no 'target' in this approach other than an arbitrary one you, the brewer, chose if trying to control pH. If estimating you, or the Solver, tries several 'targets' until you/it find the one that zeroes proton deficit.

I'm not sure that this matters much, but I found it odd. Given that Bru'n Water is largely based on the malt acidity results that Kai presented, the pH target apparently doesn't really matter too much.
Understanding that 'target pH' in this approach is not the same as the end point of Kai's titrations and considering that the titration curves are fairly close to being linear it should not matter too much what the end point of the titration was.


Knowing what I know of the engine in Bru'n Water, the methodology you present is quite similar. There are surfeits and deficits of acidity (aka: protons) that are assessed. Bru'n Water takes that net acidity (or lack of it) and uses it to predict mash pH.
Of course I don't know the details of what any calculator (other than mine) does but it is pretty clear that this is what they have to do in order to estimate pH. If things can be linearized then you don't need iterative solution. We've noted already that the malt curves can be linearized and it is also possible to linearize the carbonic acid system model but that gets a little iffy as we get into the region of mash pH. Solver is pretty easy to use but few seem to know about it. I'm sure someone could write a script to do root bisection on an Excel spreadsheet.

I like the specificity of the method you present. It moves from malt type and color estimates of acidity to a malt-specific acidity. That should provide an improvement in accuracy.

If you looked at the spreadsheet as well as the slides you will see that I took Kai's data and converted his 'acidities' to values for my first coefficient (which is the average, in the case of Kai's data, buffering capacity from DI pH to 5.7). I then fit against color so it is possible to get a rough first coefficient from color but the fit isn't very tight at all. Better than no data at all, however, and people do derive reasonable, if not spot on, pH estimates using calculators which I think do pretty much what I did.


The problem then becomes: obtaining those malt-specific acidities. I suppose if maltsters start providing those values, this would be a definite step up.
If you'll recall that water panel we sat on two summers ago I made the remark that I thought this was not an easy problem because if it were the maltsters would be supplying this data and they weren't. Evidently this put the bee into Briess's bonnet because they did go out and titrate a bunch of their malts (I think John got together with them and suggested this). What I found it is necessary to do is a lot more time consuming than what they did but perhaps they will be motivated to pursue this idea further.

However in the absence of that data, we are left in a situation where GIGO might still affect the results.
Clearly that is the case today so and people that use prediction algorithms today need to be aware of this shortcoming. That doesn't mean predictions can't be a useful tool for planning and especially for teaching.

Ultimate Reflection: A test mash is easier.
 

Latest posts

Back
Top