Target RA: 41
RA Range: 27 - 56
Target Cl/SO4: 1
Cl/SO4 Range: 0.875 - 1.125
Need:
Ca: 66
SO4: 75
Mg: 10
Na: 50
Cl: 75
Alk: 94
High Guess:per gallon
Calcium Chloride: 0.9
Gypsum: 1.1
Epsom: 0.75
Soda: 0.7
Chalk: 0.75
Guesses: Got 453 good guesses out of 25000 tries.
Showing top 6 guesses.
Salts:
| Salt | Total | Mash | Boil |
| Calcium Chloride | 3.6 | 2.95 | 0.65 |
| Gypsum | 1.4 | 1.15 | 0.25 |
| Epsom | 2.5 | 2.05 | 0.45 |
| Soda | 3.05 | 2.5 | 0.55 |
| Chalk | 0.55 | 0.45 | 0.1 |
Results:
| Ca: | 72 |
| SO4: | 83 |
| Mg: | 11 |
| Na: | 40 |
| Cl: | 83 |
| Alk: | 99 |
| RA: | 41 |
| SRM Range: | 9 - 13 |
| Chloride/Sulfate: | 0.996 - Balanced |
|
Salts:
| Salt | Total | Mash | Boil |
| Calcium Chloride | 3.05 | 2.5 | 0.55 |
| Gypsum | 1.4 | 1.15 | 0.25 |
| Epsom | 1.95 | 1.6 | 0.35 |
| Soda | 2.75 | 2.25 | 0.5 |
| Chalk | 0.55 | 0.45 | 0.1 |
Results:
| Ca: | 65 |
| SO4: | 73 |
| Mg: | 9 |
| Na: | 36 |
| Cl: | 70 |
| Alk: | 92 |
| RA: | 40 |
| SRM Range: | 8 - 13 |
| Chloride/Sulfate: | 0.962 - Balanced |
|
Salts:
| Salt | Total | Mash | Boil |
| Calcium Chloride | 3.6 | 2.95 | 0.65 |
| Gypsum | 1.4 | 1.15 | 0.25 |
| Epsom | 2.75 | 2.25 | 0.5 |
| Soda | 3.05 | 2.5 | 0.55 |
| Chalk | 0.55 | 0.45 | 0.1 |
Results:
| Ca: | 72 |
| SO4: | 88 |
| Mg: | 12 |
| Na: | 40 |
| Cl: | 83 |
| Alk: | 99 |
| RA: | 41 |
| SRM Range: | 9 - 13 |
| Chloride/Sulfate: | 0.938 - Balanced |
|
Salts:
| Salt | Total | Mash | Boil |
| Calcium Chloride | 3.3 | 2.7 | 0.6 |
| Gypsum | 0.85 | 0.7 | 0.15 |
| Epsom | 2.75 | 2.25 | 0.5 |
| Soda | 3.05 | 2.5 | 0.55 |
| Chalk | 0 | 0 | 0 |
Results:
| Ca: | 52 |
| SO4: | 74 |
| Mg: | 12 |
| Na: | 40 |
| Cl: | 76 |
| Alk: | 87 |
| RA: | 42 |
| SRM Range: | 9 - 13 |
| Chloride/Sulfate: | 1.039 - Balanced |
|
Salts:
| Salt | Total | Mash | Boil |
| Calcium Chloride | 3.85 | 3.15 | 0.7 |
| Gypsum | 1.95 | 1.6 | 0.35 |
| Epsom | 1.65 | 1.35 | 0.3 |
| Soda | 3.3 | 2.7 | 0.6 |
| Chalk | 0.3 | 0.25 | 0.05 |
Results:
| Ca: | 77 |
| SO4: | 82 |
| Mg: | 7 |
| Na: | 43 |
| Cl: | 89 |
| Alk: | 101 |
| RA: | 42 |
| SRM Range: | 9 - 13 |
| Chloride/Sulfate: | 1.082 - Balanced |
|
Salts:
| Salt | Total | Mash | Boil |
| Calcium Chloride | 3.6 | 2.95 | 0.65 |
| Gypsum | 2.2 | 1.8 | 0.4 |
| Epsom | 1.65 | 1.35 | 0.3 |
| Soda | 3.3 | 2.7 | 0.6 |
| Chalk | 0.3 | 0.25 | 0.05 |
Results:
| Ca: | 76 |
| SO4: | 90 |
| Mg: | 7 |
| Na: | 43 |
| Cl: | 83 |
| Alk: | 101 |
| RA: | 42 |
| SRM Range: | 9 - 13 |
| Chloride/Sulfate: | 0.922 - Balanced |
|
How it works:
This is based on a blog post by The Mad Fermentationist concerning the technique he uses for water treatment. It involves using two things: BreWater and John Palmer's RA spreadsheet. I'm fairly lazy and BreWater is Windows only, So I run it under wine, and I have to open Microsoft Excel to use the spreadsheet. Then, I have to compare numbers and copy, etc. Too Much Work.
This seeks to simplify water treatment. You just enter desired SRM and mineral profile and it will calculate what minerals you need to add. It was designed to be used with reverse osmosis water, so YMMV with other source water.
I copied John's calculations from his spreadsheet, so I could compare the two, and as of last check, they match. The script uses the SRM to calcuate the residual alkalinity (RA) - it uses the average from the spreadsheet. It also uses the Chloride/Sulfate ratio - this affects percieved hoppiness and/or maltiness. It also will always use Caccium of at least 50 ppm that is necessary for proper mashing.
So, how does it actually calculate things. It's very simple. It calculates a high "guess" value for each salt addition. It does this by, for example, assuming that you will derive Ca from only additions of Chalk. This value is then used as the highest possible value. This is calculated for each salt based on what it contributes. Then, a large number of random guesses is made. The salt additions are between 0 and the large "guess" value we calculated earlier. Each guess (or test set) is checked to ensure that the maximums are not exceeded and that the RA is within range. Then the test set is scored. The lowest score within the number of guesses, wins.
Scoring is very simple. It's easier to explain with an example. If target Cl is 50, and we guess to 48, then the score is (|50-48|)^2 (absolute value of target minus guess squared). In this case, the score is 4. THis is done for each mineral. The further off we are, the score grows exponentially. (Remember, lowest score wins.) For RA and Cl/SO4, they are weighted. The base score for them is multiplied by the "Score Factor." This is because they were the primary reason for me developing this in the first place. Finally, all of these scores are added to get a single score for a test set.