Bru'n Water Spreadsheet question

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.
Maybe there's a better match with salts he doesn't have but would/could easily obtain if he knew he could use them/they were beneficial.
The software I use now has all the salts that could potentially be of benefit and the ability to add any that one might conceivably think of using. Are you suggesting that there are other salts we don't know about?

Many combinations of salts can result in the same profile. Same thing with acids/bases. Go all baking soda or limit Na by adding in pickling lime, get some Mg from MgCl and some from MgSO4, get some Cl from NaCl and some from CaCl, etc....
I covered that in some detail in No. 38.

Making software that helps the end user by making suggestions *is the purpose of software*.
Hardly. Software controls my coffee pot, transforms signals from my depth sounder's transducer to images of fish (though precious few recently) on a screen, translates range measurements from GPS satellites into position data and plots it on a current map, makes sure that map is up to date, compresses audio, video and image data, manages packet switches, steers airplanes, prevents spam callers from ringing my phone, computes the amounts of salts I choose to get an ion profile I want according to an optimality condition I choose, decompresses my blue rays, converts x-ray intensity measurements to CAT scan images, controls my 3D printer, sets the mixture in my car to optimum, transmits pressure reading from my cold room compressor to my cell phone, collects readings of temperature and pressure from my heat pump and sends it to a Web sight, sends me an e-mail if the generator runs, lets me know what my portfolio is worth, automatically sends my insurance payment to the company, converts beer absorption spectra into SRM and SDC data, tells me if someone opens the garage door, automatically records displays and calibrates my pH readings, routes the traces on printed circuit boards, turns the steam on and off automatically to hold the temperature in my HLT to a desired value and, obviously, I could go on. I can think of no software that I have encountered that would "make suggestions" nor would I have any use for such nor can I imagine any manifestation of such software for this particular application. Software is there to do things we can't do (invert a large singular matrix) or don't want to do (like turning my heat pump on as necessary to hold the water in the tank at the right temperature without short cycling the compressors...) and to give us the information we need to make informed decisions.

Making software that gives a one off answer...
Software of this sort models the various brewing components which models, it is presumed, predict well how the component responds to its environment. If you feed x mEq of acid to y mmol of bicarbonate some of it will convert to carbonic acid in a way reliably predicted by the Henderson-Hasselbalch equation. Any program that wants to match an ion profile has to be aware of that. There would be no value is a program that 'advises' one to use sodium bicarbonate rather than sodium carbonate because the brewer using the program wants to use sodium bicarbonate.


and labels it as the only answer not only limits the end user but makes the software appear "dumb".
But it is the answer - the only answer unless you change the input conditions. You seem to be missing the point that the user has all the flexibility he needs. I suspect you aren't reading what I am posting but with respect to this problem and the use of Solver to solve it he can choose salts, optimality criterion, ions to be matched, weighting to be applied, set limits for a salt or salt.


Imagine such software were in place now, users would come to the "Brew Science" forum, post a screen shot of the list of amounts of salts/acids/bases" and ask "I have the ingredients for #1 but would like #3 what benefit does it have?"
Well they can do that now, of course. Not using the current popular spread sheets which do a pretty miserable job of allowing one to set a profile in some cases because the profiles are flawed. And people do it. The answers they usually get are things like "you used an acid and a base. Those cancel each other out so don't use both" or 'You used calcium carbonate, that doesn't work because it doesn't dissolve. Try sodium carbonate". Are you suggesting that the software should do that? Well it does currently. I've seen at least one spreadsheet that caveats against the use of chalk. In the one I'm working on now if you have a mash with a negative proton deficit and try to zero that by adding sauermalz you will get a message box that says you can't do that.

As opposed to mumbling conversations about mEq/L of some inane proton not balancing.
The fact that you think mention of mEq and proton balance inane only indicates that you haven't a clue as to how mash prediction and water formulation work. Proton transfer is at the very heart of it. You cannot hope to write or really even comment on brewing software if you do not understand this concept.

This would relegate knowledge to a select few but such is the current state of affairs.
I remind you that this is the Brewing Science forum. We discuss brewing science here. While it is true that one can write software for brewing applications based purely on empirical observations robust software must depend on the science.
 
I'm not really arguing but rather pointing out that what you appear to be advocating doesn't seem to make much sense in the brewing application and that an AI type solution is not desirable or necessary. Also your comment about mEq seems to indicate that you don't really understand the problem at hand or how to move towards a solution to it based on the science which is what this forum is dedicated to.

I am here to clarify any of this if I can.
 
I'm not really arguing but rather pointing out that what you appear to be advocating doesn't seem to make much sense in the brewing application and that an AI type solution is not desirable or necessary.

Not suggesting an AI solution, rather a Genetic Algorithm.

Also your comment about mEq seems to indicate that you don't really understand the problem at hand or how to move towards a solution to it based on the science which is what this forum is dedicated to.

A little bit of sarcasm and malapropism is all.

I am here to clarify any of this if I can.

Strangely your presence is comforting.
 
Not suggesting an AI solution, rather a Genetic Algorithm.

Checked the article at the link. So this is another meta heuristic algorithm - Simulated Annealing with a different way of coming up with new states to try. These methods are designed for problems where, as the article says, you haven't a clue as to how to solve them. Like an aeroplane wing where each thousands of little areas of mesh interract with hundreds of others to result in overall lift and drag characterisics. Or the deign of a new antenna where each of hundreds of mesh elements interacts with all of the others to determine the current distribution and hence the far field radiation patterns. We try this shape, calculate the current distribution and radiation pattern, see how close it is to what we'd like and if it is better than a previous try accept it and if not reject it. In simulated annealing we reject randomly with the probability dependent on the annealing "temperature". Randomly perturb and iterate. In 'Genetic algorithms' we pick new states to try by producing 'children chromasomes'. Is this more efficient than annealing? Does it lead to better convergence? Does it use less CPU cycles? I don't know and don't really think it matters much because the point is that these algorithms have their application in solving problems that we don't have a clue how to solve otherwise (routing circuit boards, the traveling salesman problem). Matching a profile by using salt additions is not one of those problems! We know very well how to solve it. It is orders of magnitude less complex than any of the four examples I've given here. We could solve it with annealing or a genetic algorithm but why would we want to? Much simpler algorithms (well annealing is pretty simple so lets say much more efficient algorithms) work just as well or better than meta hueristic algorithms so why would we not use them?

I use a meta heuristic algorithm for problems I can't solve otherwise (what your article says they are for). I'm hardly desperate here - at least not yet.
 
The question is how many combinations will be discovered using simulated annealing vs. genetic.

As I've already pointed out, the greatest possible number of combinations (preferably all) need to be discovered to be successful.
 
Let's face it.. Beersmith generates an optimized combo of water salts to achieve a chosen profile in seconds.. It's not using excel. Granted, Beersmith has many flaws in this department, but if Brad can do it, I'm sure Martin can...

Frankly, I wish Brad and Martin would get software married and combine their powers into the perfect piece of love child software....
 
The question is how many combinations will be discovered using simulated annealing vs. genetic.
We aren't really interested in finding more than one solution but if we were we would probably be interested in the solution space, not particular solutions within it. The matrix that tells us how many moles of sodium and sulfate come from 1 mole of sodium sulfate etc. is a mapping between salt space and ion concentration space. As the problem is underdetermined in general, there are many (an infinite number actually) of points in the salt space that map to a single point (the point whose coordinates represent the desired ion concentrations or the point closest to it) in the ion space. Lets say for simplicity that the ion point maps to a line in salt space. A heuristic algorithm picks a starting point (annealing) or group of (genetic) starting points in salt space and maps them into ion space. Annealing then perturbs the starting point in salt space randomly, sees whether the new point is closer to the target or not in ion space, accepts the new point if it is and if it isn't rolls the dice again to decide whether to accept it anyway. A genetic algorithm picks the points that map closest to the target in ion space, discards the rest and then "breeds" (combines) the promising corresponding points in salt space in various ways in the hope that some of the 'children' will map closer to the target point in ion space. Of course we don't know where the target point is in ion space. But we know that it is at the bottom of a well and deduce that we have moved closer to it if the error metric (norm of the vector whose elements are the desired concentration of each ion minus the mapped concentration for that ion) is reduced. Either algorithm will eventually get close enough to the line in salt space that new annealing perturbations or that new children won't deliver further reduction in the error metric. Once that line is reached the algorithm will be terminated because all we care about is that we map to the best fit point in ion space. If we do care about the extent of the solution space in the salt domain we could allow either algorithm to keep running with the criterion for accepting a new perturbation or child being that the error metric does NOT increase. This would eventually map out the solution space. There are doubtless more intelligent means for mapping out the solution space than heuristic guessing such as computing the gradient and moving perpendicular to it.

As I've already pointed out, the greatest possible number of combinations (preferably all) need to be discovered to be successful.
No. Absolutely not. Once we are in the solution space we don't care about the other solutions in that space as they are no better than the first solution we have found. Once we have the sodium and sulfate concentrations we want why would we care that they are arrived at by adding sulfuric acid and lye as opposed to sodium sulfate? Perhaps because we don't have sodium sulfate. If that's the case we wouldn't make sodium sulfate available to the algorithm. If you want to put constraints on the solution you simply change your perturbation rules such that no new annealing point or child can use more than twice as much sodium sulfate as magnesium sulfate (for example if you only had a little sodium sulfate available but plenty of Epsom salts). Or you encode the constraint into the error metric by adding a penalty to it for having sodium sulfate at more than twice magnesium sulfate. Doing either of these things would shrink the size of the solution space but again, once you have found a solution in that space you are finished.

Now interestingly enough there is one criterion for the solutions that may be of interest: finding the one that uses less total salts than any of the others. Again this could be coded into the heuristic algorithm's error function (add the norm of the salts vector to it). But there is a better way that uses far, far, far less computing and that is MPP. MPP finds the solution that has the best rms error AND has the smallest salt vector norm.

You really need to understand this in order to appreciate why heuristic algorithms are not suitable for this problem. In the quote you indicate that we need to find as many solutions as possible, preferably all of them. Do you recognize that there are an infinite number of them? How is any one better than any other? What advantage(s) do you think a heuristic algorithm would confer? And at what cost? Can you support the idea that we need to find as many solutions as possible with any information relevant to the problem at hand?

I practiced engineering for many years and over the course of them encountered many prophets with solutions looking for problems. To be honest, this seems to be one of those cases.
 
Last edited:
Maybe there's a better match with salts he doesn't have but would/could easily obtain if he knew he could use them/they were beneficial.

Many combinations of salts can result in the same profile. Same thing with acids/bases. Go all baking soda or limit Na by adding in pickling lime, get some Mg from MgCl and some from MgSO4, get some Cl from NaCl and some from CaCl, etc....

Making software that helps the end user by making suggestions *is the purpose of software*. Making software that gives a one off answer and labels it as the only answer not only limits the end user but makes the software appear "dumb".

Imagine such software were in place now, users would come to the "Brew Science" forum, post a screen shot of the list of amounts of salts/acids/bases" and ask "I have the ingredients for #1 but would like #3 what benefit does it have?" As opposed to mumbling conversations about mEq/L of some inane proton not balancing. This would relegate knowledge to a select few but such is the current state of affairs.
Wow - I didn't mean to start something like this question ended up to be.

Back to my question....
I just used a different desired profile (brown/full - hopfully OK for the Yoopers Oatmeal Stout) and think I have it close enough now. I kept futzing with the numbers by hand. I spent way more time on this than I wanted though.
I should be good here now, right?

aYoopersfinal.JPG
 
It's hard to answer your question directly because water profiles are always and forever a matter of personal preference. For my oatmeal stout I add only calcium chloride, baking soda, and salt to RO water. Enough CaCl2 to hit ~50 ppm, enough baking soda to hit a targeted 5.50 mash pH, and then lastly enough NaCl to hit 60 ppm sodium.

Edit: I can't read your numbers clearly enough in the attached screenshot to see what analyticals you achieved, or what targeted mash pH you settled upon.
 
Last edited:
Wow - I didn't mean to start something like this question ended up to be.

Back to my question....
I just used a different desired profile (brown/full - hopfully OK for the Yoopers Oatmeal Stout) and think I have it close enough now. I kept futzing with the numbers by hand. I spent way more time on this than I wanted though.
I should be good here now, right?

View attachment 585711

You haven't started anything that wasn't present long before your question was asked.

Your water will be ok. It's best not to rely on those built in profiles, instead learn about what each mineral does and the level that's appropriate for the style. Then you can simply make your own profile on the fly. As discussed earlier, matching those profiles exactly doesn't add anything to the beer. Heck you could just put a teaspoon of CaCl and a teaspoon of Gypsum in your water w/ the baking soda and you most likely wouldn't tell the difference between that and your meticulously labored over salt additions.
 
We aren't really interested in finding more than one solution but if we were we would probably be interested in the solution space, not particular solutions within it. The matrix that tells us how many moles of sodium and sulfate come from 1 mole of sodium sulfate etc. is a mapping between salt space and ion concentration space. As the problem is underdetermined in general, there are many (an infinite number actually) of points in the salt space that map to a single point (the point whose coordinates represent the desired ion concentrations or the point closest to it) in the ion space. Lets say for simplicity that the ion point maps to a line in salt space. A heuristic algorithm picks a starting point (annealing) or group of (genetic) starting points in salt space and maps them into ion space. Annealing then perturbs the starting point in salt space randomly, sees whether the new point is closer to the target or not in ion space, accepts the new point if it is and if it isn't rolls the dice again to decide whether to accept it anyway. A genetic algorithm picks the points that map closest to the target in ion space, discards the rest and then "breeds" (combines) the promising corresponding points in salt space in various ways in the hope that some of the 'children' will map closer to the target point in ion space. Of course we don't know where the target point is in ion space. But we know that it is at the bottom of a well and deduce that we have moved closer to it if the error metric (norm of the vector whose elements are the desired concentration of each ion minus the mapped concentration for that ion) is reduced. Either algorithm will eventually get close enough to the line in salt space that new annealing perturbations or that new children won't deliver further reduction in the error metric. Once that line is reached the algorithm will be terminated because all we care about is that we map to the best fit point in ion space. If we do care about the extent of the solution space in the salt domain we could allow either algorithm to keep running with the criterion for accepting a new perturbation or child being that the error metric does NOT increase. This would eventually map out the solution space. There are doubtless more intelligent means for mapping out the solution space than heuristic guessing such as computing the gradient and moving perpendicular to it.

No. Absolutely not. Once we are in the solution space we don't care about the other solutions in that space as they are no better than the first solution we have found. Once we have the sodium and sulfate concentrations we want why would we care that they are arrived at by adding sulfuric acid and lye as opposed to sodium sulfate? Perhaps because we don't have sodium sulfate. If that's the case we wouldn't make sodium sulfate available to the algorithm. If you want to put constraints on the solution you simply change your perturbation rules such that no new annealing point or child can use more than twice as much sodium sulfate as magnesium sulfate (for example if you only had a little sodium sulfate available but plenty of Epsom salts). Or you encode the constraint into the error metric by adding a penalty to it for having sodium sulfate at more than twice magnesium sulfate. Doing either of these things would shrink the size of the solution space but again, once you have found a solution in that space you are finished.

Now interestingly enough there is one criterion for the solutions that may be of interest: finding the one that uses less total salts than any of the others. Again this could be coded into the heuristic algorithm's error function (add the norm of the salts vector to it). But there is a better way that uses far, far, far less computing and that is MPP. MPP finds the solution that has the best rms error AND has the smallest salt vector norm.

You really need to understand this in order to appreciate why heuristic algorithms are not suitable for this problem. In the quote you indicate that we need to find as many solutions as possible, preferably all of them. Do you recognize that there are an infinite number of them? How is any one better than any other? What advantage(s) do you think a heuristic algorithm would confer? And at what cost? Can you support the idea that we need to find as many solutions as possible with any information relevant to the problem at hand?

I practiced engineering for many years and over the course of them encountered many prophets with solutions looking for problems. To be honest, this seems to be one of those cases.

 
Now that's more like it. Clearly we want an agorithm that gives the right answer and there are lots of those. I this case any one of the right answers will do as none of the others give us a better match to the target profile. But what about on the salt side? The answer that uses the least amount of salt seems a reasonable one to select and MPP gives us that one automatically so it seems a reasonable choice. If we want to steer to a right answer that meets some other criterion we can do that too with MPP. It seems the obvious choice except that we need to implement SVD to use it. Doable but a PITA.
 
Now that's more like it. Clearly we want an agorithm that gives the right answer and there are lots of those. I this case any one of the right answers will do as none of the others give us a better match to the target profile. But what about on the salt side? The answer that uses the least amount of salt seems a reasonable one to select and MPP gives us that one automatically so it seems a reasonable choice. If we want to steer to a right answer that meets some other criterion we can do that too with MPP. It seems the obvious choice except that we need to implement SVD to use it. Doable but a PITA.

Are you talking about Maximum Power Point w/ singular value decomposition or some mutilated form of the image processing boundary finding MPP (minimum perimeter polygons)? I can't recall if SVD is discussed in Numerical Recipes (haven't referenced my copy for years).

I still think the user should be exposed to all of the right answers *if they so choose* and each of those answers should be labeled (least amount of salts) (closest match to target - RMS) etc...
 
Wow - I didn't mean to start something like this question ended up to be.

Back to my question....

As this is the Brewing Science thread you can expect that some aspects of Brewing Science may be raised in response to any post here. It's been noted that profiles really kind of a joke - especially the one's that come with first generation spreadsheets and calculators. A water profile consists of a list of ion concentrations. What the authors of the first gen spreadsheets didn't appreciate is that some of the ion concentrations depend on pH. Have you seen a profile that mentions pH? In Brun water Martin wanted, for each profile, a certain concentration of calcium, of magnesium etc. to, for example, match the water of the Isar.He realized that if he just specified those desired amounts there would be a positive ion imbalance that he would have to balance somehow. His solution to this was to balance with bicarbonate (which is indeed what the ions of the Isar are balanced by). So he threw in bicarbonate as necessary to balance each profile. In fiddling with salts to hit a profile one can then add sodium bicarbonate to supply that carbonate as long as the pH of the synthesis is 8.34, the pH at which 98% of the bicarbonate in sodium bicarbonate stays sodium bicarbonate. Thus all of the profiles in Brun are for pH 8.38. How can that be of help to use wanting to synthesize at pH 7 or mash pH?

I'm trying to figure out how to get minerals correct to the recipe for Yoopers Oatmeal Stout recipe. I doubled the recipe for a 11 gallon batch.

I entered Yoopers water numbers as a custom water profile. Before I add anything to the water, the pH is in the correct range. Whenever I add anything to the water, the pH number goes down and gets out of range. How can I correct this?
I'm afraid the answer is to use a better spreadsheet. Some things you add to water (acids, acid malts, blend water with low pH and appreciable alkalinity cause the pH to go down). Other things cause it to go up and still others (neutral salts) should make little if any change.

All of this is more or less mooted by the fact that profiles really aren't that important. Get rid of the alkalinity by whatever means you choose and get the stylistic ions (calcium, chloride, sulfate, sodium) into the ballpark for the style and you are in good shape. These can be tweaked, of course, to make even more pleasing beer. Thus profile matching isn't really that important to a brewer. But, as you may have gathered from some of the noise here, it belongs to a class of problems that is of great interest to engineers and scientists in many disciplines.
 
Last edited:
Are you talking about Maximum Power Point w/ singular value decomposition or some mutilated form of the image processing boundary finding MPP (minimum perimeter polygons)?
You are clearly not reading what I am posting. So why am I posting? Helps me think about this stuff much of which I haven't used in quite a while. Anyway MPP was introduced in No. 38 and mentioned in several other posts. It stands for Moore-Pensrose Pseudoinverse.

I can't recall if SVD is discussed in Numerical Recipes (haven't referenced my copy for years).
Further evidence you aren't reading what I am posting. Also from No. 38.

Excel doesn't have SVD capability. It is available, free, as a plug in but I don't realistically expect that even the more advanced brewers would be willing to accept my add in and the Real Statistics add in. The alternative would be for me to haul out Numerical Recipes and port the FORTRAN to VBA. Doable but it's a fairly lengthy piece of code.

I still think the user should be exposed to all of the right answers *if they so choose* and each of those answers should be labeled (least amount of salts) (closest match to target - RMS) etc...
Use some common sense! There are an infinite number of right answers none of which is any closer to the target match than any other. How will you present those to the user? Will you expose the user to the right answers that contain negative amounts of a salt? I guess I choose not to be exposed to such answers.
 
I will implement a Genetic Algorithm and you can implement Moore-Penrose PseudoInverse with Singular Value Decomposition.

May the best algorithm win.
 
His solution to this was to balance with bicarbonate (which is indeed what the ions of the Isar are balanced by). So he threw in bicarbonate as necessary to balance each profile. In fiddling with salts to hit a profile one can then add sodium bicarbonate to supply that carbonate as long as the pH of the synthesis is 8.34, the pH at which 98% of the bicarbonate in sodium bicarbonate stays sodium bicarbonate. Thus all of the profiles in Brun are for pH 8.38. How can that be of help to use wanting to synthesize at pH 7 or mash pH?

AJ if you wouldn't mind, could you rework the 'true' value of whatever ion(s) you feel is incorrect in that water profile in order to show just how wrong I was with my assumption?

Thanks!
 
Which water profile?

When I last looked at Brun water I totted up all the ions for several profiles and noted that they were balanced. But only at pH 8.4. If you consider any other pH the profiles aren't balanced any more. The charge on bicarbonate changes with pH. The charge on calcium magnesium, sodium, potassium, chloride and sulfate don't (well sulfate does but not enough to worry about). Thus the profiles only balance at 8.38 and as I recall there is a statement to that effect. So I don't know what I can correct. I can offer you a set of software functions that you could plug in to resolve this problem but I don't think you are interested.
 
Well, for example:
Ca:50 Mg:5 Na:27 SO4:50 Cl:60 HCO3:85

As you point out, its really only the alkalinity that varies and I've elected to represent alkalinity with only bicarbonate. The other ionic concentrations are consistent.

I believe I've mentioned this in the past; I use bicarb since its the species that predominantly exists in the range of typical mashing pH. That should be a reasonable assumption.

I guess the other non-concern I have with the bicarb not being accurate, is that alkalinity (bicarb) content is the component that I feel is the first to adjust in our quest for proper mashing pH.
 
Well, for example:
Ca:50 Mg:5 Na:27 SO4:50 Cl:60 HCO3:85
There is, assuming they balance, nothing wrong with that. It is true at any pH. The problem is that a user trying to synthesize a profile will do so by adding sodium bicarbonate (at least I think that's the way it works) either as a a source of sodium or of the bicarbonate which the profile has led him to believe he needs. That approach is only correct for a synthesis at pH 8.38. It is not correct for a synthesis at pH 7 or any other pH.

As you point out, its really only the alkalinity that varies and I've elected to represent alkalinity with only bicarbonate. The other ionic concentrations are consistent.
The problem there is that the relationship between alkalinity and bicarbonate is not a constant. It depends on source water pH - not strongly, but the dependence is there. IMO that problem pales in comparison to the problem of confusion of the user who adds some lime to his RO water to be told it now has bicarbonate in it.

I believe I've mentioned this in the past; I use bicarb since its the species that predominantly exists in the range of typical mashing pH. That should be a reasonable assumption.

I guess the other non-concern I have with the bicarb not being accurate, is that alkalinity (bicarb) content is the component that I feel is the first to adjust in our quest for proper mashing pH.
Yes, but how do we dispose of alkalinity? We add acid in an amount equal to the alkalinity - not the alkalinity as measured in the lab to pH 5.4 or 5.5 but the alkalinity between the source pH and the mash pH. If we assume pH 7 is nominal for source water and look at the variation between 6.5 and 10 (probably the maximum range of source water pH's a brewer might expect to see) the variation in that alkalinity is ±5% and thus you will have error of that magnitude in the amount of acid a program that ignores source pH will recommend. I know you are firmly in the "Better is the enemy of good enough." school but I am not. It's a philosophical difference.
 
I know you are firmly in the "Better is the enemy of good enough." school but I am not. It's a philosophical difference.

Fair enough.

In the case of sparging water where the source water pH would have an effect, its in Bru'n Water. However, in the case of mashing water where the buffering of the malt is going to dominate, would source water pH really have much effect?
 
Fair enough.

In the case of sparging water where the source water pH would have an effect, its in Bru'n Water. However, in the case of mashing water where the buffering of the malt is going to dominate, would source water pH really have much effect?

The way I have been interpreting all the new and exciting information flowing through the forum in the last month or so is like so: When you have a bunch of things, in this case calculations, that each introduce only a small percent error, but when summed up add to a significant error, it's advantageous to root those out and eliminate them.

This is especially true for the majority of pH estimation software users who really are "flying blind" and putting trust in the estimations themselves.

I think A.J. pointed out when the discussion of what we are referring to as "Gen II" software came about that the strength of using tools like Excel and other software tools is their ability to quickly do calculations that would be cumbersome otherwise. From that standpoint, you may as well knockout all contributors of even small percent errors, so that the estimation as a whole doesn't suffer from their combined errors.
 
Wouldn't a multitude of random errors be far more likely to somewhat cancel each other out than to be always 100% additive.

If software is guessing the direction and magnitude that the mash pH will take for each of 5 malts in a grist, and it overestimates for 2 and underestimates for 3, the result will not be the same as for if it had underestimated (or overestimated) for all 5.
 
In the case of sparging water where the source water pH would have an effect, its in Bru'n Water. However, in the case of mashing water where the buffering of the malt is going to dominate, would source water pH really have much effect?
The malts exhibit buffering in both the mashing and sparging phases. Depending on the properties of the water and the malts their relative effects on the pH of the mix will vary. In no case is this a huge effect.

As the post after yours points out there is really no reason given the better understanding of the chemistry we now have and the amazing computing power of today's desktops and capabilities built into even the humble spreadsheet to stamp out these little errors. Other than philosophical ones.
 
Wouldn't a multitude of random errors be far more likely to somewhat cancel each other out than to be always 100% additive.
The probability of them being 100% additive is 0. The probability that they will exactly cancel is also 0. This is why we use rms error when dealing with error budgets.

If software is guessing the direction and magnitude that the mash pH will take for each of 5 malts in a grist, and it overestimates for 2 and underestimates for 3, the result will not be the same as for if it had underestimated (or overestimated) for all 5.
If we had a model for each malt and knew the first model produced an error of 1, the second an error of 2, the third 3, the fourth 4 and the 5th 5 we would say that if equal amounts of the malts were analyzed using these models we would, subject to certain assumptions, often made when they really aren't justified, that the rms error would be sqrt(1^2 + 2^2 + 3^2 + 4^2 + 5^2) = 7.4162. One of the assumptions is that the individual model erros are independent of one another and random such that, for example, the error of 1 stated for the first implies that the actual error returned by it is between -1 and 1 with 68% probability, between -2 and 2 with 96% probability and between -3 and +3 with probability 99%. The combined error we would similarly interpret as meaning that an estimate base on those 5 models would be show error between - 7.42 and + 7.42 68% of the time.

See some further comments on the post after yours.
 
Last edited:
Not sure if this is related - law of propagation of uncertainty - some pretty grizzly stuff unless you're a statistician.
Yes it is absolutely related and the bread and butter of any engineer trying to design a measurement or estimation system and of course lots of other people too (including statisticians). For example in trying to determine the accuracy of a pH meter reading we look at the accuracy of the buffers, the electrical noise introduced by the electronics, the temperature measurement error and the "geometry" of the problem (the J matrix in the linked article) and try to figure out which are the big contributors to the overall error and go after them.

To try to put this into perspective relative to the problem of pH estimation - there are several sources of error with Gen 1 programs. One is malt models. Another is failure to consider source water pH. A third is failing to realize that acid and bases proton releasing/absorbing powers are not constants. The errors caused by these errors could be entered into an error budget. The overall error of the program would be rss'ed as in the example in my last post:

sqrt(1^2 + 2^2 + 3^2 + 4^2 + 5^2) = 7.4162

Note that
sqrt(0^2 + 2^2 + 3^2 + 4^2 + 5^2) = 7.34847

The point being that because of the sqrt of sum of squares process eliminating the smallest errors does not decrease the rms error much. Thus fixing the source water pHs problem in Brun water would not improve it much if it continues to use color based models for malt acid/base properties. Nor will a Gen II program than has eliminated the pHs problem altogether be appreciably better if it bases its malt properties model on color alone.
 
Last edited:
Wow - I didn't mean to start something like this question ended up to be.

Back to my question....
I just used a different desired profile (brown/full - hopfully OK for the Yoopers Oatmeal Stout) and think I have it close enough now. I kept futzing with the numbers by hand. I spent way more time on this than I wanted though.
I should be good here now, right?

View attachment 585711
I feel your pain.

FWIW: I input your treated water values and grain bill into MME and it told me I needed to add .3lb of acid malt to hit the 5.4 mash pH. With no acid malt it comes in at 5.48
 

Attachments

  • Screen Shot 2018-08-30 at 9.19.53 PM.png
    Screen Shot 2018-08-30 at 9.19.53 PM.png
    166.8 KB · Views: 39
I will implement a Genetic Algorithm and you can implement Moore-Penrose PseudoInverse with Singular Value Decomposition.

May the best algorithm win.
And how will we know which is best?

Actually, the reason I am posting tonight is because whilst in the shower this morning I remembered that the very first time I solved this problem (i.e. matching a target ion profile with a handful of salts) I did it with a heuristic algorithm! I had totally forgotten this. And I did it for the reason mentioned in the genetic algorithm web page linked in No. 44: I didn't have a clue as to how to solve the problem. That was quite a while ago. The thing ran in FORTRAN overnight on an Apple laptop with a black and white screen but it did give good answers. So if anyone thinks I'm poo-pooing heuristic algorithms because I don't think they will work disabuse yourself of that notion. They do work and are actually very easy to program - you are just making semi educated guesses as where to go next in the solution space. It's pretty easy to stay away from absolutely correct but absurd solutions (ones with negative salt additions) this way. The challenge I face with the MPP approach is directing the search to a correct but reasonable solutions using it. It works with GPS, it ought to work here.
 
I feel your pain.

FWIW: I input your treated water values and grain bill into MME and it told me I needed to add .3lb of acid malt to hit the 5.4 mash pH. With no acid malt it comes in at 5.48


Tribe Fan, in viewing your MME attachment it is clear that you have seriously messed up the input Lovibond colors for a number of your malt inputs into MME.

1) Maris Otter is 2.8L, and you are using 9L
2) Victory is 28L and you are using 9L
3) Acid Malt is around 3-4L and you are using 20L (though for this case it doesn't matter to the outcome)
4) I must presume that 200L for Chocolate represents something like Fawcett's Pale Chocolate, otherwise 200L is rather seriously low for most chocolate malts.

5) Also, a 50/50 blend of flaked Oats and flaked barley would be about DI_pH 5.9, but you manually over-road this with 6.55. Flaked Oats and Flaked Barley have their own individual drop-downs, so no need to conflate them and then guess at their combined DI_pH.

I'm not certain as to your intended goal here, but the old saying is 'garbage in, garbage out'.
 
Tribe Fan, in viewing your MME attachment it is clear that you have seriously messed up the input Lovibond colors for a number of your malt inputs into MME.

1) Maris Otter is 2.8L, and you are using 9L
2) Victory is 28L and you are using 9L
3) Acid Malt is around 3-4L and you are using 20L (though for this case it doesn't matter to the outcome)
4) I must presume that 200L for Chocolate represents something like Fawcett's Pale Chocolate, otherwise 200L is rather seriously low for most chocolate malts.

5) Also, a 50/50 blend of flaked Oats and flaked barley would be about DI_pH 5.9, but you manually over-road this with 6.55. Flaked Oats and Flaked Barley have their own individual drop-downs, so no need to conflate them and then guess at their combined DI_pH.

I'm not certain as to your intended goal here, but the old saying is 'garbage in, garbage out'.
I must have been delirious with joy from Cody Allen finishing an inning without blowing the game.

Here's the adjusted grain bill. The chocolate malt L is from the screeenshot grain bill from the OP. It says .4# of acid malt is needed to bring the mash pH to 5.4. Without is is at 5.51

Screen Shot 2018-08-31 at 6.42.32 AM.png Screen Shot 2018-08-31 at 6.56.36 AM.png

Intended goal here was to just give the OP some feedback on his initial question, because you know, beer.
 
Better, but improvements can still be made:

1) Victory is a specialty malt.
2) Roast Barley is a Roasted Barley, not a Roasted Malt (there is no malting done to roast barley).
3) And for a bit of nitpicking, I still prefer to let the software determine the acid malt addition rather than adding it directly into the grain bill, as the weight/quantity calculation is more precise that way.

What OS and spreadsheet version are you using? I can see where it isn't properly handling the font types/sizes for you as it does for me and I may need to revise them to suit your spreadsheet. One of the perils of my not owning a copy of Excel perhaps.
 
Better, but improvements can still be made:

1) Victory is a specialty malt.
2) Roast Barley is a Roasted Barley, not a Roasted Malt (there is no malting done to roast barley).
3) And for a bit of nitpicking, I still prefer to let the software determine the acid malt addition rather than adding it directly into the grain bill, as the weight/quantity calculation is more precise that way.

What OS and spreadsheet version are you using? I can see where it isn't properly handling the font types/sizes for you as it does for me and I may need to revise them to suit your spreadsheet. One of the perils of my not owning a copy of Excel perhaps.
I'm using Google Sheets. v3.1 MME.

I wondered on the acid malt addition because it is slightly different when you put it on the actual grain bill.
 
Ah, then Google Sheets has issues with the fonts. Unless you are using a Chromebook or something like it, whereby installing software isn't possible, you might want to consider a free download and install of LibreOffice, as it will clean things up and look more presentable. I don't necessarily want to fight with modifying MME in an attempt to make it look nice in Google Sheets.
 
OK Tribe Fan and Silver Is Money (and everyone else)
I think that I have Bru'n Water figured out, me futzing with the numbers enough to add 4.4g of Gypsum, 4.4g of CaCl and 3.6g of Baking Soda for my 14.5 gallons of water before mashing to reach the near the suggested numbers. This I can understand.

But when using MME, I enter the same grain bill and you're telling me that I don't need to add any water additions and I still can get a similar mash pH? But I also thought that mashing is better or more efficient when these minerals are added and you end up with better tasting beer. Am I wrong here? Are minerals good to add, or not? Why don't we all just brew with RO water and no minerals added?

And yes, the dropdown options for the grains confused me as well - I don't know what types of grain apply to which dropdown option. But that's my lack of knowledge by being a new all-grain brewer. I'm sure I'll get there eventually.

Here is what I get with Bru'n Water and MME:
bYoopersOatmealStoutGrainBill.JPG bYoopersOatmealStoutWaterAdjustment.JPG bYoopersOatmealStoutAdjustmentSummary.JPG MMEMash.JPG MMEWater.JPG

The bottom image is what MME calculated before I changed the water additions to zeros. Is it that MME says I only need to add a small amount of Baking Soda. Is that grams/gal? OR grams for the entire 14.5 gallons of water?
MMEMashBackToOriginal.JPG

And in the last screenshot, telling MME to use the same additions in the same quantity as Bru'n Water - different Baking Soda amounts and I end up with different mash pH. I just figured out that MME is calculating the acids/base to add automatically, based on my pH goal?

MMEMatchBrunWater.JPG


I also noticed that when I entered the same additions to MME as I chose in Bru'n Water, the ppm numbers were very similar.
How can I change the Baking Soda amount to change the estimated pH in MME?

Since Bru'n Water has some suggestions on goals for ppm numbers, I have to say I like that better. Even though I don't know if those suggestions are correct or not. But being a new all-grain brewer, I don't have the knowledge to tell what my goals should be.

These water calculators have a tough job... Be easy enough for people like me who have no clue what Grist Buffering Capacity is or how to get that info and complex enough for people who really know what they're talking about.
 
Last edited:
MME uses grams per batch, and not grams per Liter or grams per Gallon. And yes, MME is forecasting acid/base amounts to be added to hit your target pH for the "batch", and not by the gallon or the liter. It tells you what is required. In MME you do not hunt and peck and guess at acids or bases in a frustrating effort to hit upon what is required to be added in order to approach your desired mash pH target. As opposed to MME, most other of such software doesn't even ask for your input as to your desired mash pH target. In effect the others are making you do all of the work, whereas MME instantly does it for you.

Mash Made Easy is not informing you to add zero minerals. It does not guide as to mineral additions at all. They are strictly your personal preference, and are to be added at your discretion. Add them for flavor. Then adjust the mash pH. All MME is saying is that your grist can mash at right close to 5.4 pH even when no minerals are present. Although others have done it, I would not personally make a beer with zero minerals, as it would likely result in a dull and characterless beer as to its flavor. Add minerals for flavor and then acids or baking soda only as needed to achieve a mash pH target. The two are mutually exclusive in my thinking (opinion). I.E., I would not personally chase a mash pH target by playing with adding or subtracting minerals. To do so alters the originally intended flavor goals, and why would you mess with flavor merely to hit a pH target?

You can alter the recommended Baking Soda addition by altering your personally selected mash pH target, or by altering your mineralization, or by altering your grist, or by altering your primary base malts DI_pH selector (via the drop down cell in lower right), or by altering the buffering (which I do not recommend, but which you may find useful for fine tuning if you find that the default value here is driving your mash pH downward strictly with regard to added Ca++ and/or Mg++ mineralization by more (or less) than you actually hard measure for such minerals via a pH meter).
 
Last edited:
And how will we know which is best?

Actually, the reason I am posting tonight is because whilst in the shower this morning I remembered that the very first time I solved this problem (i.e. matching a target ion profile with a handful of salts) I did it with a heuristic algorithm! I had totally forgotten this. And I did it for the reason mentioned in the genetic algorithm web page linked in No. 44: I didn't have a clue as to how to solve the problem. That was quite a while ago. The thing ran in FORTRAN overnight on an Apple laptop with a black and white screen but it did give good answers. So if anyone thinks I'm poo-pooing heuristic algorithms because I don't think they will work disabuse yourself of that notion. They do work and are actually very easy to program - you are just making semi educated guesses as where to go next in the solution space. It's pretty easy to stay away from absolutely correct but absurd solutions (ones with negative salt additions) this way. The challenge I face with the MPP approach is directing the search to a correct but reasonable solutions using it. It works with GPS, it ought to work here.

I just said that more tongue in cheek than anything else.

I suppose one could come up with some criteria, though it may be rather artificial, to determine if one algorithm is "better" than another. If some of those criteria had practical application like "algorithm z finds 20x more solutions y times faster than algorithm k" or perhaps something based on the quality of the solutions found, etc...

But like I mentioned, I was just joking around more than anything.

BTW, that's a neat story about your experience with a heuristic algorithm.
 
The MME water profile I used already included your mineral salt additions, 5g of gypsum, 5g of cacl, 4g of baking soda to 14.5 gal of RO water at your initial profile. That's why the screenshot has 0 in the additions area.

Apologies if I added any more confusion here. Not advocating one SS over another. I use MME so I thought I would input the grain bill there to give another reference point.

As you stated, you'll get the same ppm profile from both spreadsheets. MME and BW use different calculations for the mash pH.
 
The MME water profile I used already included your mineral salt additions, 5g of gypsum, 5g of cacl, 4g of baking soda to 14.5 gal of RO water at your initial profile. That's why the screenshot has 0 in the additions area.

Apologies if I added any more confusion here. Not advocating one SS over another. I use MME so I thought I would input the grain bill there to give another reference point.

As you stated, you'll get the same ppm profile from both spreadsheets. MME and BW use different calculations for the mash pH.

What Tribe Fan is saying is that on the "Water" sheet for MME he added the ppm's for all of your added minerals, so in doing it that way (his preference) he did not also need to add them on the initial screen, as doing so would be double dipping on the mineral additions, and would double them as to ppm, and seriously mess up the mash pH forecast accordingly. To my knowledge, the same can be done with any of the available mash pH assistant software currently out there.
 

Latest posts

Back
Top