Brewing Functions Spreadsheet

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 some of you are already aware I have put together a spreadsheet (yes, another spreadsheet) which, while it can certainly be used for planning brews and is quite flexible, was actually developed to showcase a set of VBA functions which are potentially useful to people who want to put together spreadsheets of their own customized to their own particular ways to doing things. Of course this includes developers.

There are 64 functions. Some of them do handy things like convert SG to Plato and the converse but most of them are used in estimating mash pH or in estimating acid or base additions needed to hit a desired mash pH given a chosen grist composition. Invocation is the same as with any other Excel function e.g. if you type =Plato(1.040) into a cell the Plato value corresponding to 1.040 SG will appear in that cell. There is a modest sized malt data base. Malt properties are modeled by a DI pH and three (linear, square, cubic) buffering terms. Users can populate the data base with any malt data they have i.e. if they feel they can derive pHDI and a (and b and c) from some other information such as malt type, color or the maltster's childrens' names they have they are free to do so.

The main thing being offered here is the ability to predict and control mash pH based on the science of acid/base chemistry. Alkalinity is not modeled as a constant times the bicarbonate ion content. It is not assumed that source water pH doesn't matter. It is not assumed that mash pH is a linear function of malt pH or color. It is not assumed that blended waters properties don't depend on the pHs of the waters mixed. It is not assumed that phosphoric and lactic acids release 1 proton per molecule independent of mash pH nor that sodium bicarbonate absorbs 1 per molecule. Thus these functions eliminate many of the small error sources inherent in what we have started to refer to as "first generation" spreadsheets. Thus, "second generation" spreadsheets put together using these functions should return better answers than first gen. spreadsheets provided they are fed good malt data.

There is a manual which documents the function calls and lays out the basics of the proton accounting method of mash pH determination and control.

The current versions of spreadsheet and manual are at brewingfunctions.yolasite.com.

Come back with any questions or comments.
 
Last edited:
Awesome work AJ. I've been playing around but haven't had a chance to dive that deeply. Definitely adding this to my to do list.
 
I've posted new versions of both the workbook and the manual. The manual just added documentation of some functions I'd missed. In the spreadsheet itself you probably won't notice anything but I did some minor repairs in the way acids and bases are handled and pH is estimated on the fly (i.e. whenever you change anything that effects mash pH).
 
I've posted updates to the workbook and manual. Nothing exciting. Just squashing of a couple of bugs for the most part. For those who have been interested in the Riffe approach to pH estimation I've added cells in the summary section that show the Riffe (linear - no iteration) approximation and the single step from 5.4 Newton improvement to it (the Riffe approach is Newton's method using a single step from 0). These come from the function pH_1step which requires the malt data to be laid out as in the sample spreadsheet summary block (but it can be located anywhere). To get the Riffe result pass 0 for GuesspH. To use the improved Riffe pass a value for GuesspH close to what you think the answer will be (5.4 for example).
 
To use the improved Riffe pass a value for GuesspH close to what you think the answer will be (5.4 for example).
@ajdelange When comparing the grist DIpH estimations using current versions of MpH and MME I saw the following when using 100% RO water.

MpH - US 2-Row (Base) 1.8L with 5.72 DIpH / Crystal 90L (Crystal) 90L with 4.18 DIpH Total pH = 5.68
MME - US 2-Row (Base) 1.8L with 5.76 DIpH / Crystal 90L (Crystal) 90L with 4.62 DIpH Total pH = 5.73

Obviously, there is a difference of 0.06pH between the two. Could you please provide steps that I can follow take to replicate the calculation using your Brewing Functions Spreadsheet?
 
Last edited:
@ajdelange When comparing the grist DIpH estimations using current versions of MpH and MME I saw the following when using 100% RO water.

MpH - US 2-Row (Base) 1.8L with 5.72 DIpH / Crystal 90L (Crystal) 90L with 4.18 DIpH Total pH = 5.68
MME - US 2-Row (Base) 1.8L with 5.76 DIpH / Crystal 90L (Crystal) 90L with 4.62 DIpH Total pH = 5.73

Obviously, there is a difference of 0.06pH between the two. Could you please provide steps that I can follow take to replicate the calculation using your Brewing Functions Spreadsheet?

I'm a bit confused. US 2-Row Brewers at 1.8L defaults to a DIpH of 5.57 in MME. You are closer with the 90L crystal, as it defaults to 4.63 DIpH, which is not quite your 4.62, but close.

BTW, Maris Otter (if it was 1.8L, which it is not) defaults to 5.76 DIpH in MME. Therefore my guess is that you have not made the correct base malt selection via the drop down cell in the lower right hand corner.
 
I'm a bit confused. US 2-Row Brewers at 1.8L defaults to a DIpH of 5.57 in MME. You are closer with the 90L crystal, as it defaults to 4.63 DIpH, which is not quite your 4.62, but close.

BTW, Maris Otter (if it was 1.8L, which it is not) defaults to 5.76 DIpH in MME. Therefore my guess is that you have not made the correct base malt selection via the drop down cell in the lower right hand corner.
@Silver_Is_Money I'll admit this may or may not be related to user error on my part. Please see screenshot below...

mme-1.jpg


...the Drop down default was set to ~5.72 to 5.77 DI_pH.
 
@Silver_Is_Money I'll admit this may or may not be related to user error on my part. Please see screenshot below...

View attachment 590951

...the Drop down default was set to ~5.72 to 5.77 DI_pH.

Well, you've done some futzing with it, but that aside, why would you force US 2-Row Brewers malt to act like Maris Otter? I have multiple sets of data for this malt from Briess, and they all range between 5.53 and 5.58 DIpH, with the majority clustering at about 5.57 DIpH.
 
Well, you've done some futzing with it, but that aside, why would you force US 2-Row Brewers malt to act like Maris Otter? I have multiple sets of data for this malt from Briess, and they all range between 5.53 and 5.58 DIpH, with the majority clustering at about 5.57 DIpH.
I'm not sure what you mean by futzing? All I did was enter US 2-Row using the defaults? Please explain I'm not criticizing only trying to understand how to use the tool. Briess 2-row is 1.8L and I have no idea what the DIpH value is.
 
@ajdelange When comparing the grist DIpH estimations using current versions of MpH and MME I saw the following when using 100% RO water.

MpH - US 2-Row (Base) 1.8L with 5.72 DIpH / Crystal 90L (Crystal) 90L with 4.18 DIpH Total pH = 5.68
MME - US 2-Row (Base) 1.8L with 5.76 DIpH / Crystal 90L (Crystal) 90L with 4.62 DIpH Total pH = 5.73

Obviously, there is a difference of 0.06pH between the two. Could you please provide steps that I can follow take to replicate the calculation using your Brewing Functions Spreadsheet?

The first thing you would do is go to Sheet3 and enter the malts data into 4 rows in the malt database. You are in trouble already because you have no information about the buffering of the malts - only the DI pH. I can't seem to get across that I cannot predict a mash pH knowing only the DI pH of the malts any more than I can tell you how long it would take you to get to my house knowing only how far away you are from it. I also need to know how fast you will be driving. Fortunately, just as with driving where we can assume you will average 50 mpH we can with malts assume that the buffering in -40 mEq/kg/pH. So enter the malt name, the DI pH and -40 into the first 3 columns. Also enter the expected extract as a percentage of the grain weight in the appropriate columns.

Now go to Sheet 1 and enter beer volume and mash water volumes. Select the desired volume units first. Then press the distilled water button to set the pJ amd alkaliniity of distilled water. Now go to the first malt selection line, select pounds for the malt weight and select the malts you want to use in the pH computation. Enter the malt weights. Check that no acids or bases have been specified in the lower part of the spreadsheet. The predicted mash pH, 5.73 for the MME malts, appears in B15 and also in the summary area where you will also see the Riffe estimate and improved Riffe estimates which are all, as there is nothing non linear in your mash, the same. There is, if everything is assumed linear, no advantage to using anything more sophisticated than the Riffe formula. It is when things become non linear that the value of the full iterative or improved Riffe may be seen.
 
I'm not sure what you mean by futzing? All I did was enter US 2-Row using the defaults? Please explain I'm not criticizing only trying to understand how to use the tool. Briess 2-row is 1.8L and I have no idea what the DIpH value is.

3 decimal points of precision visible indicates at least some minimum level of futzing.

Did you follow the embedded instructions within the 3L or lower base malt DI_pH cell (drop-down cell in lower right corner)? They tell you which selection setting you should choose (within this cell, by clicking to activate the drop-down) for each base malt. Hover the cursor over the cell (before clicking on it) for instructions. Some Excel versions may still present the red triangle in the corner of the cell which must be clicked upon in order to show the instructions.
 
Last edited:
Yes, Larry in that regard I did some futzing with your spreadsheet for nothing more than educational purposes. And based on what I've seen so far I think you've done a fine job with your version 4.10 approach. Although I'm still trying to learn how to use it correctly.

In Excel, there is a 'Data Validation' feature. It allows users to click on a label to display comments instead of looking for red triangles. The comments did work in your spreadsheet. After selecting the 1st option in the drop down the DI_pH value changed to 5.57. Which is lower than the 5.72 DI_pH predictions of MpH 3.0. Over the coming months, I will be evaluating the mash pH predictions of several software packages and comparing the results to my actual pH measurements.
 
Thank you for your directions AJ. I see you've included Crystal 90L [Briess] on Sheet3 with a pHdi of 4.77. Which is much higher than the predicted 4.18 DIpH in MpH 3. I get what you're saying about needing more information to go on than is commonly available. But I do see the potential your spreadsheet has. I just keep looking for different ways to use it.

On another note, I gave my pH meter a pretty good workout this past weekend. Taking pH readings 30 minutes into the mash and post boil. I even took a pH reading of a tea made from a pound of fresh Spruce tips used in the holiday beer I brewed. I will be ordering additional supplies this week. Calibration solutions, Citric acid, and a few other items for titration testing.
 
After selecting the 1st option in the drop down the DI_pH value changed to 5.57. Which is lower than the 5.72 DI_pH predictions of MpH 3.0.

That's most likely because MpH (like the others of gen 1) does not permit user selection of DI_pH for base malts, but rather assumes a midrange of some sort, which for many base malts will simply be incorrect. Sometimes mash pH damagingly so.
 
Thank you for your directions AJ. I see you've included Crystal 90L [Briess] on Sheet3 with a pHdi of 4.77.

Per Briess data, some outlier lots of their 60L Caramel weigh in with a bit lower DIpH values than that. And they show a competitors 75L crystal at 4.69 and a competitors 90L crystal at 4.59 (wherein the Briess process admittedly yields caramel, and there are some rather apparent pH differences in their data between caramel and crystal (due to differences in processing to achieve one type or the other, I will initially presume).
 
It's been a while but I've just posted updated versions of the spreadsheet and manual (brewingfunctions.yolasite.com). Mostly minor things, bug fixes etc. but there is a new function. AlkEnd(alk, pHs, pHa, pHe, Vol). With Vol = 1 L (which is a default) this function takes alkalinity as measured to a titration end point of pHa and returns the equivalent alkalinity at titration end point pHe. You must also pass it the sample pH, pHs. This would be useful for converting a Ward Labs reported alkalinity to an ISO alkalinity and the defaults for pHa = 4.4 and pHe = 4.5 are set up to do this.

Alk end is more broadly useful in that it will compute the alkalinity of a water (with pH = pHs) to which adding alk mEq of acid brings about a pH change from pHs to pHa. Thus one can simply determine his alkalinity without doing a titration (well I guess its a titration with only one acid addition). People using the 0 alkalinity method could thus easily track their suppliers alkalinity over time.
 
Back
Top