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.
I'm trying hard to keep an open mind here. @Silver_Is_Money can you define what constitutes 'merely negligible' in a real world brewing situation?

Not really, but if it induces an error on the order of 3% or more, perhaps that is where it stops being negligible. A.J. considered a 2.1% error sufficient cause to apply a fix earlier in this thread.
 
I've noted in some posts here that in some of the spread sheets RA is used to estimate mash pH or mash pH shift, Martin has stated plainly that he uses RA and, though I tried to convince him otherwise, John Palmer thinks RA is the way to go to the point where he told me he wanted to make it the central theme of his book. So I thought I'd see if RA really has a place here. From a purely empirical point of view of course it does. If we have water with bicarbonate in it (alkaline water) and add a bunch of calcium and malt we know that the calcium will react with the phytin to produce acid which, clearly, will neutralize some of the bicarbonate thus reducing the effective alkalinity. The alkalinity not removed by the H+ ions from this reaction is 'residual'. It was Kolbach's intent to present a measure which could be used to compare source waters. Roughly speaking, a water with twice the residual alkalinity of another water would require twice the acid to treat the water as would be required to treat the other water.

As stated several times throughout the thread in order to predict mash pH or determine the amount of acid (or base) required to set a desired mash pH we must solve

-∑_i Vi*ci*Qai(pHz) + ∑_i (mi/gi)*Qbi(pHz) + Vw*Ct*(Qc(pHz) - Qc(pHs)) + Vw*(Qw(pHz) - Qw(pHs) + Vw*H/3.5 + ∑_i mi*(ai*(pHz - pHDi) + bi*(pHz - pHDi)^2+ci*(pHz - pHDi)^3) = 0

for either pHz or one of the acid (Vj representing the volume of an acid of molar strength gi) or base terms (mj representing the mass of a solid base with molecular weight gi) depending on whether we are estimating or setting pHz. Ct is the total carbo per liter of mash water (volume Vw), pHs is that water's pH, mi are the masses of the individual malts, ai, bu and ci are their coefficients and pHDi their DI mash pH's. Now this equation does not contain RA but it contains something like it. Kolbach defined RA as simply

RA = alk - ([Ca++]/3.5 + [Mg++]/7) in which alk is the water's alkalinity (in mEq/L) and the bracketed quantities the hardnesses in mEq/L. To simplify

RA = alk -H/3.5 in which H = [Ca++] + [Mg++]/2

Though Kolbach probably never intended it most spreadsheet authors deduct the amount of acid they have added from Kolbach's RA and call that the RA

RA = alk -H/3.5 -∑_i Vi*ci*Qai(pHz)

Most spreadsheet authors are unaware (or choose to ingnore because it doesn't make a great difference) that the number of protons supplied by lactic and phosphoric acids depends on pHz so for them the amount of acid added is sumply the number of mmol of it and if we do that too then ∑_i Vi*ci*Qai(pHz) = ∑_i Vi*ci as Qai(pHz) is presumed to be 1. For further simplicity lets assume that there is only one acid so that we can represent the sum by just A, the number of millimoles of acid. Then

RA = alk -H/3.5 - A/Vw

with A divided by Vw as RA is per liter. Then

Vw*RA = Vw*alk - Vw*H/3.5 - A

represents the proton deficit of the mixture of mash water and added acid. The sum of the terms in the charge equation that represent these components is

Vw*Ct*(Qc(pHz) - Qc(pHs)) + Vw*(Qw(pHz) - Qw(pHs) + Vw*H/3.5 - A

Dividing through by Vw puts us on a per liter basis:

Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) + H/3.5 - A/Vw

From this it is clear that if Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) = alk then we could just substitute RA for it in the main equation. This would be great if we could get away with it because then, by ignoring bi and ci malt terms we would have

RA + ∑_i mi*(ai*(pHz - pHDi)) = 0 which is linear in pHz

RA + pHz*∑_i mi*ai - ∑_i mi*ai*pHDi = 0

and

pHz = (∑_i mi*ai*pHDi - RA)/∑_i mi*ai

This is, I believe, what many of the spreadsheets try to do. Note that it even separates pHz into a sum of terms: one due to the malt and one due to the mash water. Of course it isn't going to work that well because we have ignored the non linearities in the malts and in the proton deficit from water alkalinity and ignored the fact that added acids don't actually donate 1 mEq of protons per mmol. So what do we do? We tweak the last formula to make things fit observed data better. I think the popular programs do this by comparison with reported errors from their users or beta testers. Given that with base malts the pH differences between pHDi and pHz are not that large ignoring their non linearities isn't going to cause that much error. With the colored malts (pHz - pHDi) will be larger but as these malts are used in quantity small relative to the base malt quantity perhaps the errors aren't that great but we have noted over the years that when HBTers report the wilder pH variations from Bru'n water the beer in question is often a dark one.

While Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) ≠ alk there is a definite relationship between them. Ct is calculated from alk and pHs, the water's source pH. In fact

Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) = f* alk

where f is a factor, usually around 0.9, that gives the proton deficit of the water/calcium/acid mix (still ignoring the dependence of acid strength on pHz) in terms of the alkalinity. Users of the RA based method will improve their pHz estimates if the use RA = f*alk -H/3.5 - A/Vw in computing RA with the catch being, of course, that f is a function of pHz and pHs. A couple of iterations will resolve that, of course, but the whole idea of forcing linearity is to dodge the recursion bullet. Values of f are found on the following graph:
ratios.jpg

A spreadsheet author could declare that the average brewer would be shooting for pH 5.4 and would have mash water of pH 7.5 and use 0.88 tweaking this in response to observed error reports. An important conclusion is that if your spreadsheet doesn't ask you for the source water's pH and especially if it asks for or prefers bicarbonate to alkalinity (forces you to convert an alkalinity report to a bicarbonate value before entering) be wary.
 
Not really, but if it induces an error on the order of 3% or more, perhaps that is where it stops being negligible. A.J. considered a 2.1% error sufficient cause to apply a fix earlier in this thread.
After applying changes to MME v1.65 have pH predictions improved by 2-3% on real-world recipes?
 
After applying changes to MME v1.65 have pH predictions improved by 2-3% on real-world recipes?

Well, with all of the coding and watching this thread I've been doing for the past few days I haven't brewed any batches to find out. Plus they would take at least a couple weeks anyway....

Along with patching the current Mash Made Easy series (in the version 1.XX range) I've also been hard at work on Version 2.00, which effectively has had a completely new engine installed, and which will stamp out major issues that have developed in 1.XX as I've been modifying it, whereby somewhere along the line its results turned BAD for darker brews, and really BAD for really dark brews. I've made a number of major changes to 2.00, but the biggest is that all calculations involving pH are now based on Log Base 10, seeing as the pH scale itself is a Log Base 10 system. The differences don't show up for lighter colored brews, but kick in "exponentially" as brews become darker in color. I recall where Martin discovered something along the lines of what I was seeing, and which motivated him to come out with a revision to correct for this about a year of two ago, when he discovered that the really dark malts have way more acidity than he had originally anticipated, so back then I should have realized the same, but I'm old and slow. Kicking the tires on 2.00 now. Stay tuned. After this one is released, and it may be later today (???), I think I'll need a vacation from spreadsheet coding in order to unwind. I've tossed everything including the kitchen sink into 2.00, and I believe it will stand for awhle before needing revision.

One thing I discovered just last night as I was looking through my Briess DI_pH data, and which is another one that may rock the house, is that the deeply roasted grains which are not malted (such as roasted barley, in any of its Lovibond colors) are far less acidic than the dark roasted/malted barleys (which can get down right acidic by comparison to the darkest of the non malted grains). So version 2.00 will do away with "Deep Roasted" and replace this class with "Roasted Barley" and "Roasted Malt". The two classes are simply too far apart to keep together in a single class.
 
Last edited:
I've noted in some posts here that in some of the spread sheets RA is used to estimate mash pH or mash pH shift, Martin has stated plainly that he uses RA and, though I tried to convince him otherwise, John Palmer thinks RA is the way to go to the point where he told me he wanted to make it the central theme of his book. So I thought I'd see if RA really has a place here. From a purely empirical point of view of course it does. If we have water with bicarbonate in it (alkaline water) and add a bunch of calcium and malt we know that the calcium will react with the phytin to produce acid which, clearly, will neutralize some of the bicarbonate thus reducing the effective alkalinity. The alkalinity not removed by the H+ ions from this reaction is 'residual'. It was Kolbach's intent to present a measure which could be used to compare source waters. Roughly speaking, a water with twice the residual alkalinity of another water would require twice the acid to treat the water as would be required to treat the other water.

As stated several times throughout the thread in order to predict mash pH or determine the amount of acid (or base) required to set a desired mash pH we must solve

-∑_i Vi*ci*Qai(pHz) + ∑_i (mi/gi)*Qbi(pHz) + Vw*Ct*(Qc(pHz) - Qc(pHs)) + Vw*(Qw(pHz) - Qw(pHs) + Vw*H/3.5 + ∑_i mi*(ai*(pHz - pHDi) + bi*(pHz - pHDi)^2+ci*(pHz - pHDi)^3) = 0

for either pHz or one of the acid (Vj representing the volume of an acid of molar strength gi) or base terms (mj representing the mass of a solid base with molecular weight gi) depending on whether we are estimating or setting pHz. Ct is the total carbo per liter of mash water (volume Vw), pHs is that water's pH, mi are the masses of the individual malts, ai, bu and ci are their coefficients and pHDi their DI mash pH's. Now this equation does not contain RA but it contains something like it. Kolbach defined RA as simply

RA = alk - ([Ca++]/3.5 + [Mg++]/7) in which alk is the water's alkalinity (in mEq/L) and the bracketed quantities the hardnesses in mEq/L. To simplify

RA = alk -H/3.5 in which H = [Ca++] + [Mg++]/2

Though Kolbach probably never intended it most spreadsheet authors deduct the amount of acid they have added from Kolbach's RA and call that the RA

RA = alk -H/3.5 -∑_i Vi*ci*Qai(pHz)

Most spreadsheet authors are unaware (or choose to ingnore because it doesn't make a great difference) that the number of protons supplied by lactic and phosphoric acids depends on pHz so for them the amount of acid added is sumply the number of mmol of it and if we do that too then ∑_i Vi*ci*Qai(pHz) = ∑_i Vi*ci as Qai(pHz) is presumed to be 1. For further simplicity lets assume that there is only one acid so that we can represent the sum by just A, the number of millimoles of acid. Then

RA = alk -H/3.5 - A/Vw

with A divided by Vw as RA is per liter. Then

Vw*RA = Vw*alk - Vw*H/3.5 - A

represents the proton deficit of the mixture of mash water and added acid. The sum of the terms in the charge equation that represent these components is

Vw*Ct*(Qc(pHz) - Qc(pHs)) + Vw*(Qw(pHz) - Qw(pHs) + Vw*H/3.5 - A

Dividing through by Vw puts us on a per liter basis:

Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) + H/3.5 - A/Vw

From this it is clear that if Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) = alk then we could just substitute RA for it in the main equation. This would be great if we could get away with it because then, by ignoring bi and ci malt terms we would have

RA + ∑_i mi*(ai*(pHz - pHDi)) = 0 which is linear in pHz

RA + pHz*∑_i mi*ai - ∑_i mi*ai*pHDi = 0

and

pHz = (∑_i mi*ai*pHDi - RA)/∑_i mi*ai

This is, I believe, what many of the spreadsheets try to do. Note that it even separates pHz into a sum of terms: one due to the malt and one due to the mash water. Of course it isn't going to work that well because we have ignored the non linearities in the malts and in the proton deficit from water alkalinity and ignored the fact that added acids don't actually donate 1 mEq of protons per mmol. So what do we do? We tweak the last formula to make things fit observed data better. I think the popular programs do this by comparison with reported errors from their users or beta testers. Given that with base malts the pH differences between pHDi and pHz are not that large ignoring their non linearities isn't going to cause that much error. With the colored malts (pHz - pHDi) will be larger but as these malts are used in quantity small relative to the base malt quantity perhaps the errors aren't that great but we have noted over the years that when HBTers report the wilder pH variations from Bru'n water the beer in question is often a dark one.

While Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) ≠ alk there is a definite relationship between them. Ct is calculated from alk and pHs, the water's source pH. In fact

Ct*(Qc(pHz) - Qc(pHs)) +(Qw(pHz) - Qw(pHs) = f* alk

where f is a factor, usually around 0.9, that gives the proton deficit of the water/calcium/acid mix (still ignoring the dependence of acid strength on pHz) in terms of the alkalinity. Users of the RA based method will improve their pHz estimates if the use RA = f*alk -H/3.5 - A/Vw in computing RA with the catch being, of course, that f is a function of pHz and pHs. A couple of iterations will resolve that, of course, but the whole idea of forcing linearity is to dodge the recursion bullet. Values of f are found on the following graph:
View attachment 578805
A spreadsheet author could declare that the average brewer would be shooting for pH 5.4 and would have mash water of pH 7.5 and use 0.88 tweaking this in response to observed error reports. An important conclusion is that if your spreadsheet doesn't ask you for the source water's pH and especially if it asks for or prefers bicarbonate to alkalinity (forces you to convert an alkalinity report to a bicarbonate value before entering) be wary.

AJ,

One question and one comment:

Pardon my ignorance but what is the Q value?

I copied your troubleshooter code from here into an excel sheet and I think I want to take a crack at figuring out the code and making a sheet that is a middle ground between it and the more common color based sheets. Research, research, research...
 
I've been taking A.J.'s Q values to be mEq's. But I will defer to his confirmation (or denial, or correction) of this assumption on my part.

Edit: If you zero out the lactic acid addition field and then divide the resulting mEq's (delta total Q) which pop up in column 77 by A.J.'s value of ~13 mEq's/mL for 88% lactic acid, you get the same mL's answer as the one you just zeroed out. This should confirm that the Q's are mEq's.
 
Last edited:
Yes, the Q values are charges and measured in mEq, or mEq/L

As for what is an acceptable level of approximation error my feeling is that the answer is "none" if you can eliminate it. Some errors you can't and we're stuck with those. But the point of the spread sheet is to illustrate that many of them can be knocked out pretty simply. If you've taken care of these you don't have to worry about how big you can let them become.

BTW I love the idea of calling the spreadsheet a 'trouble shooter'. I think of it as a voltmeter for water calculators.
 
Last edited:
Yes, the Q values are charges and measured in mEq/L

As for what is an acceptable level of approximation error my feeling is that the answer is "none" if you can eliminate it. Some errors you can't and we're stuck with those. But the point of the spread sheet is to illustrate that many of them can be knocked out pretty simply. If you've taken care of these you don't have to worry about how big you can let them become.

BTW I love the idea of calling the spreadsheet a 'trouble shooter'. I think of it as a voltmeter for water calculators.

When I graduated from college at the ripe age of 29 in 2014, I went to work for Nine Mile Point nuclear station in Oswego as an electrical design engineer. Most of the work I did was troubleshooting: electromechanical relays, breakers, etc.

It's a term I love to apply to homebrewing because I think much of what you do when you have a more scientific approach in brewing is troubleshooting.
 
BTW I love the idea of calling the spreadsheet a 'trouble shooter'. I think of it as a voltmeter for water calculators.

So I was inspired to play around with the engine behind AJ's troubleshooter. I reformatted it in order to get a better understanding about how it worked and in the process added a few creature comforts of my own:

https://drive.google.com/open?id=15EJcCWYXTcm_4B_w9AOUAFRLpybT--kC

Capture.JPG


What I wanted to do was modify it to be able to compare to my own modded MpH sheet with the results from his troubleshooter, which i am coming to trust as very reliable.

Essentially I modified my own sheet with a separate reference cell to calculate the Mash pH with salts using the pH shift method and mEq. It's found here:

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

Capture.JPG


I set up the two sheets with as close to identical settings as I could. I used 1.7 L malt in my sheet and 5.75 pH DI in both. CaCl, CaSO4, and MgSO4 as well as lactic acid amounts were kept the same. I then used the solver to zero out Qtotal by varying the target pH, i.e. matching the Mash pH (Acids) values for both sheets. The results are as follows:

deLange - 5.5873
Modded MpH (stock mEq/l pH calc) - 5.5604 (-0.0269)
Modded MpH (revised mEq pH shift) - 5.5836 (-0.0037)

Pretty cool!
 
Last edited:
I downloaded both. Very impressive. How do you do it so quickly?

Excel is my jam. I’m not an Excel guru in general but I am used to doing brewing stuff in Excel so I format very quickly.

What I’m gong to try and do is keep reworking AJs base troubleshooting engine and building it out. The goal for now is to use the solver to solve for pHz based on acid and mineral inputs. I can keep adding creature comforts until I come up on territory which may start to mess with what is so good about his sheet and then contemplate how to proceed.
 
AJ,

Do you have any insights on how we can model Sauermalz in the troubleshooter? I could reverse engineer Kai’s calcs, but seeing as I’ve taken to calling this the deLange Water Troubleshooter, I figured I’d get your input first.

EDIT: Another question I have is this: for color based acidity used by many water sheets, are we essentially approximating a value for co-efficient a for use in a linear approximation of the series solution? How does the color based acidity relate to co-efficient a?
 
Last edited:
When I measured Weyermann's sauermalz I got, for pHDI, a, b and c
Weyermann Sauermalz 3.6165 -292.09 68.443 -5.3985

Joe Walts (who only made three measurements) data yields

Sauermalz Weyermann Joe Walts 3.41 -345.93 69.432 0

Kai measured 2 samples. His measurements yield.

Sauermalz 3.43 -138.8546256 0 0
Sauermalz Weyermann 3.44 -158.4955752 0 0

The question about a and color is a good one. Run dowm dmr's Part III paper referenced earlier in this thread. He has some data in which he relates color to a. As I've said before I think it is in answering questions like that that the challenge lies. Getting the math right is pretty easy.
 
When I measured Weyermann's sauermalz I got, for pHDI, a, b and c
Weyermann Sauermalz 3.6165 -292.09 68.443 -5.3985

Joe Walts (who only made three measurements) data yields

Sauermalz Weyermann Joe Walts 3.41 -345.93 69.432 0

Kai measured 2 samples. His measurements yield.

Sauermalz 3.43 -138.8546256 0 0
Sauermalz Weyermann 3.44 -158.4955752 0 0

What about modeling Sauermalz based on Lactic acid % and weight?
 
Last edited:
The question about a and color is a good one. Run dowm dmr's Part III paper referenced earlier in this thread. He has some data in which he relates color to a. As I've said before I think it is in answering questions like that that the challenge lies. Getting the math right is pretty easy.

I wonder if the answer is wrapped up in Riffe’s calculation of Grist pH:

Grist pH = pH DI - ( 0.0337 (kg/mEq) * SUM ( f * A ) )

where 0.0337 is a slope term whose inverse is buffering capacity, f is the grist fraction of the particular malt, and A is the color based acidity.

If we were to make the Qmalt term from the troubleshooter linear, we’d have:

Qmalt = a * ( pHz - pH DI)

If we rework Riffe’s equation a bit by renaming Grist pH pHz and inverting 0.0337 to get Buffering Constant (Bc) = 29.67 we get:

pHz = pH DI - ( Bc (mEq/kg) * SUM ( f * A ) )

- ( Bc (mEq/kg) * SUM ( f * A ) ) = ( pHz - pH DI )

That's where I am at right now and I'm not sure there is a relation after that.



EDIT: I added in Sauermalz to the troubleshooter by reverse engineering KW 1.58. The calculation is as follows:

QSauermalz (mEq) = ( 1000 * ( Sauermalz Lactic Acid % / 100 ) * Sauermalz (g) ) / 90

for 111 grams of 3% Sauermalz, KW 1.58 shows a pH shift of -0.13. After using the solver in the deLange Water Troubelshooter, pH shift is -0.148. So on the right track...
 
Last edited:
What about modeling Sauermalz based on Lactic acid % and weight?
That's not going to work because while sauermalz does contain acid (sauer) it also contains malt (malz). Thus in addition to the buffering of the lactate ion there is buffering from the malt anions too. The following graph shows the measured titration curve for 1 kg sauermalz (Weyermann) and for 50 grams (5% of a kg) of lactic acid
LacticSAUER.jpg
 
That's not going to work because while sauermalz does contain acid (sauer) it also contains malt (malz). Thus in addition to the buffering of the lactate ion there is buffering from the malt anions too. The following graph shows the measured titration curve for 1 kg sauermalz (Weyermann) and for 50 grams (5% of a kg) of lactic acid
View attachment 578917

AJ,

This is the excerpt from my post above:

I added in Sauermalz to the troubleshooter by reverse engineering KW 1.58. The calculation is as follows:

QSauermalz (mEq) = ( 1000 * ( Sauermalz Lactic Acid % / 100 ) * Sauermalz (g) ) / 90

for 111 grams of 3% Sauermalz, KW 1.58 shows a pH shift of -0.13. After using the solver in the deLange Water Troubelshooter, pH shift is -0.148. So on the right track...

It seems to be moving in the right direction, although your point is well taken. In trying to develop a color based estimate of a, I wonder if we could add an acidity term in the f * A summation where Sauermalz is modelled as a base malt. Sauermalz is Pilsner malt is after all.
 
Last edited:
If one assumes (on first approximation) that acidulated malt is roughly 3% lactic acid by weight, then couldn't you just multiply the weight of your recipes added acid malt by 0.03 and then, utilizing the resultant new weight, treat it from that point forward as if it was now at a concentration of 100% lactic acid? I'm always trying to simplify. I know that for minute precision the graph above details that this approach won't work, but will it be in the proverbial ballpark?
 
If one assumes (on first approximation) that acidulated malt is roughly 3% lactic acid by weight, then couldn't you just multiply the weight of your recipes added acid malt by 0.03 and then, utilizing the resultant new weight, treat it from that point forward as if it was now at a concentration of 100% lactic acid? I'm always trying to simplify. I know that for minute precision the graph above details that this approach won't work, but will it be in the proverbial ballpark?

See my correction above. I mistakenly left off the grams of Sauermalz.
 
I haven't lost interest in case anyone wondered. It's been too busy for me to devote the time needed to absorb it all. You are all doing amazing work!
 
So I am doing a comparison between what I refer to as the "deLange Linear" Grist pH model and the pHG model from the Riffe spreadsheet. I think I may have an initial linear equivalent to the deLange Linear equation using malt color.

deLange Linear -> ∆Qmalt (mEq) = a * ( pHz - pH DI )

We know that in the troubleshooter, if we zero out all other Q values except the malt, that to solve for pHz, we would vary ∆Qmalt. So let's solve for pHz:

pHz = pH DI + ( ∆Qmalt (mEq) / a )

Riffe Grist pH -> pHg = pH DI - ( SGpH * Am (mEq/kg) )

In the Riffe equation, SGpH = 0.0337 (kq/mEq) and is the slope of pHg vs. Am, where Am is color based malt acidity with units (mEq/kg). The inverse of SGpH is malt buffering capacity, or Bg, and has units of mEq/kg. So, for all intents and purposes:

a = Bg

So:

deLange Linear -> pHz = pH DI + ( ∆Qmalt (mEq) / Bg )

Riffe Grist pH -> pHg = pH DI - ( ( Am (mEq/kg) * Grist Weight (kg) ) / Bg )

In the end, it doesn't really give us anything for relating a to color but starts to show an equivalency between the calculations. One issue i'm seeing however is that the values when comparing AJ's ∆Qmalt (mEq) DO NOT even remotely match values for Am (mEq). (EDIT: Of course they don't! The Q values change with solver so you have to use the solver to change Qmalt to Am by varying pHz. Duh!)

to be continued...
 
Last edited:
I did some work on this today. For the purposes of simplifying some stuff, I trimmed the deLange portion so it's just minerals, Lactic Acid, Malt and my Sauermalz portion. The assumption is that we are using RO/DI water with 0 effective alkalinity. I know this inst totally realistic but it simplified some of the content.

I then added some typical water spreadsheet style inputs using a mix of Riffe, my own stuff, and AJ's troubleshooter. I hosted it at LOB.com so that AJ could check it out:

http://www.********************/wp-...deLange-Water-Troubleshooter-Solver-copy.xlsx
 
Last edited:
For anyone interested, I took AJ's raw information for the troubleshooter and put it alongside a reconfigured and formatted version I put together:

http://www.********************/wp-content/uploads/2018/0deLange-Water-Troubleshooter.xlsx
 
Last edited:
The past few days I have been looking for a good way to combine what I have been learning in this thread with what I now know is the most solid way of calculating pH (the deLange troubleshooter charge method). I re-read Riffe's most recent paper on grist buffering and DI pH and have come up with a basis for calculating Grist pH using my brewing sheet. It looks something like this:

pHg = Grist pH
pH DI = Distilled water pH of a single base malt ∑
Bg = Buffering capacity of a single malt of any type
fm = Fraction of grist for each malt
Am = Color based malt acidity for each malt
pH DI/kg = Weighted average of single base malt's pH DI value
Bg/kg = Weighted average of a single malt's buffering capacity

pHg = ∑ pH DI/kg + ( ∑ fm * Am /- ∑ Bg/kg ) (1)

This equation would be used in a normal spreadsheet situation where one didn't plan on using the solver. However, if one was willing to integrate the use of the solver into their spreadsheet (which i'm considering), then you could use a linear form of AJ's equation:

Q (mEq) = ∑ Bg/kg * (pHz - pH DI) (2)

Then you could use the charge conservation method with Q's and the solver embedded into a brewing spreadsheet that will do your recipe calcs as well. This is my plan and i'll compare outcomes from equation 1 and 2.
 
Last edited:
Are you considering that pH is emphatically a logarithmic function? Perhaps I'm missing something, but (unless Bg is based upon the log scale) I don't see any logarithmic nature to your pH equations.
 
Are you considering that pH is emphatically a logarithmic function? Perhaps I'm missing something, but (unless Bg is based upon the log scale) I don't see any logarithmic nature to your pH equations.

I'm not following. Are you talking about a log function somewhere in the calculation? Equation 2 above is just for the malt portion and derives directly from AJ's troubleshooter. It doesn't take into account any of the acid inputs or mineral inputs. Equation 1 is a modified version of Riffe's Grist pH calculation that substitutes a generic buffering capacity value for a weighted average of all the individual malt's buffering capacities and a weighted average of all the base malt pH DI values.

I'm not sure where log fits into any of it.
 
Are you considering that pH is emphatically a logarithmic function? Perhaps I'm missing something, but (unless Bg is based upon the log scale) I don't see any logarithmic nature to your pH equations.
Bg, the buffering, is in units of mEq/kg•pH. I don't really know what 'color based acidity' is but given that it is called acidity I assume it is in units of mEq/kg. Dividing by mEq/kg•pH would give (mEq/kg)/(mEq/kg•pH) = pH.

dmr adds some confusion in his paper by stating that pH is, as it is the log of something, dimensionless. In particular -log(acH+/acref) where acH+ is the activity of hydrogen and acref is a reference activity equal to 1, is dimensionless because acH+/acref is dimensionless. But even so -log(acH+/acref) does have dimension because there is a defined pH scale dependent on the choice of acref and the type of logarithm Sørenson chose to use. Had he chosen to use the natural rather than the Briggs logarithm the scale would be different. The pHaj of pure water would be -ln(1e-7) = 16.1181 and we would express buffering in terms of mEq/kg•pHaj
 
Bg, the buffering, is in units of mEq/kg•pH. I don't really know what 'color based acidity' is but given that it is called acidity I assume it is in units of mEq/kg. Dividing by mEq/kg•pH would give (mEq/kg)/(mEq/kg•pH) = pH.

dmr adds some confusion in his paper by stating that pH is, as it is the log of something, dimensionless. In particular -log(acH+/acref) where acH+ is the activity of hydrogen and acref is a reference activity equal to 1, is dimensionless because acH+/acref is dimensionless. But even so -log(acH+/acref) does have dimension because there is a defined pH scale dependent on the choice of acref and the type of logarithm Sørenson chose to use. Had he chosen to use the natural rather than the Briggs logarithm the scale would be different. The pHaj of pure water would be -ln(1e-7) = 16.1181 and we would express buffering in terms of mEq/kg•pHaj

A.J.: For clarity, does variable 'Bg' contain buried within it a hidden true logarithmic nature, or is it somewhat empirical in that regard?
 
Color based acidity is the commonly used Lovibond based approximation of the grain's Q value in mEq/kg.

This is effectively what I've been eluding to when I state that the data (although you can squeeze a slope out of it) appears to be nigh-on derived from "scatter charts". You can only squeeze so much from a turnip. My spreadsheet is in the same boat with all others in this regard. I have some Briess data for my slopes, and others use their own collected data to create these scatter charts and derive "nominal" value from them. Either way the "fit" is somewhat (to perhaps highly) questionable in the end, and I believe this is what A.J. doesn't understand (as in likely: "I can't understand why everyone but me is willing to get along while using such bad data fits".).
 
A.J.: For clarity, does variable 'Bg' contain buried within it a hidden true logarithmic nature, or is it somewhat empirical in that regard?

Bg is the buffering capacity or a co-efficient of the malt being used. It is empirical in this case. It can be used to make a linear approximation of the series expansion that AJ shows.

Q = a * (pHz-pH DI) + b * (pHz-pH DI)^2 + c * (pHz-pH DI)^3

becomes

Q = a * (pHz-pH DI) = Bg * (pHz-pH DI)

Riffe's Mash pH III paper goes into this in a lot more detail.
 
Color based acidity is the commonly used Lovibond based approximation of the grain's Q value in mEq/kg.

This is effectively what I've been eluding to when I state that the data (although you can squeeze a slope out of it) appears to be nigh-on derived from "scatter charts". You can only squeeze so much from a turnip. My spreadsheet is in the same boat with all others in this regard. I have some Briess data for my slopes, and others use their own collected data to create these scatter charts and derive "nominal" value from them. Either way the "fit" is somewhat (to perhaps highly) questionable in the end, and I believe this is what A.J. doesn't understand (as in likely: "I can't understand why everyone but me is willing to get along while using such bad data fits".).

Well at least I got the units right. The problem I am having is that Q is a function of two pH's: pHDi and pHz. pHDi you can approximate from the color and yes, I do recognize that the fit is poor. Lots of people think "Wow, Pearson's r is 0.8, that's a pretty good fit!" and it is but I then encourage people to hoke up some data with r = 0.8 and see how good a predictor of, in this case, pHDI, the color of the malt is.

But given that we accept that we have a usable estimate of pHDi what do we use for pHz? I faintly recall discussing this with Kai way back when and I think he decided to measure the amount of acid necessary to get to a particular pH, IOW to make two measurements and as I think of it that is indeed what he did because I am able to take his two measurements and compute a ≈ mEq_acid_added/(pHDi - pH_with_acid). So now I think I understand what A is but am still not 100% sure. Given that the units are mEq/kg then it is the acid required to get to a particular pH. But that assertion is confounded by dmr's pratice of declaring pH dimensionless so that to his way of thinking the actual buffering in mEq/kg•pH would be written as mEq/kg. Perhaps deeper study of his paper would reveal the answer.
 
A.J.: For clarity, does variable 'Bg' contain buried within it a hidden true logarithmic nature, or is it somewhat empirical in that regard?
Yes, in the sense that its units are mEq/kg•pH and pH is clearly a logarithmic measure. But I'll admit that dmr's calling it mEq/kg because he thinks pH is dimensionless and the knowledge that you guys rely heavily on his paper has gotten me a bit unclear on this.

On another subject: I've noticed responses coming back pretty quickly at 9:48 in the morning. Putting this together with some remarks you guys have made I need to ask "Are we a bunch of old retired farts who ought to be sitting on the park bench feeding the pigeons?"
 
On another subject: I've noticed responses coming back pretty quickly at 9:48 in the morning. Putting this together with some remarks you guys have made I need to ask "Are we a bunch of old retired farts who ought to be sitting on the park bench feeding the pigeons?"

I'd probably sleep better at night if I sat on a park bench and fed pigeons rather than worrying about all of this stuff.

But then again, our futzy 19 year old cat insists upon breakfast at 4:00 AM (+/- ~ 15 minutes) and she lets my wife and I know about it good and loudly every morning.
 
On another subject: I've noticed responses coming back pretty quickly at 9:48 in the morning. Putting this together with some remarks you guys have made I need to ask "Are we a bunch of old retired farts who ought to be sitting on the park bench feeding the pigeons?"

I've got about 30 more years to go! I was 29 when I graduated from RPI in 2014 so I'm not there quite yet.

I think more clearly in the morning! Give me a minute and i want to post something for you guys to check out...
 
Ok. So here is a brewing sheet I made (adapted, I should say, from an in-progress sheet) that incorporates the mechanics of AJs troubleshooter and does away with all color based acidity calcs:

http://www.********************/wp-content/uploads/2018/07/Brewing-Sheet-v1.1.xlsx

It's a brewing sheet so it does recipe input. It uses Bg values from Riffe in his Mash pH III paper, assumes distilled water, and (at least I think so) incorporates all the proper calcs for Lactic acid and minerals. I'll admit that I reverse engineered the % of grist based Sauermalz calcs and used them here to show the acidity from Sauermalz, but also used AJ's co-efficient for Sauermalz in the Bg/kg summation.

pH DI values and Bg values are stored in the grain database. Those pH DI values are averages across 3 years worth of Weyermann lots for the respective malts (2015, 2016, 2017 and a few from 2018).

Solver should be used to zero out Q total by varying Mash pH.
 
Last edited:
Ok. So here is a brewing sheet I made (adapted, I should say, from an in-progress sheet) that incorporates the mechanics of AJs troubleshooter and does away with all color based acidity calcs:

http://www.********************/wp-content/uploads/2018/07/Brewing-Sheet-v1.1.xlsx

I tried to run it in LibreOffice Calc 6.0, and it fails with a statement that says something (from memory) loosely akin to: This spreadsheet contains links to other files, but they are not available. Not having Excel, I may be out of luck here.
 
On another subject: I've noticed responses coming back pretty quickly at 9:48 in the morning. Putting this together with some remarks you guys have made I need to ask "Are we a bunch of old retired farts who ought to be sitting on the park bench feeding the pigeons?"

hah another question might be does anyone have a day job, and if so, why aren't they doing that instead?

Of course i say this as i'm HBT'ing on client time....

This conversation is FAR more interesting than what i'm supposed to be doing though.
 
Back
Top