# HG changeset patch # User Michiel Broek # Date 1598386326 -7200 # Node ID 8dae8479d5e8271cce95ae62c8c2722946feabaf # Parent 65da479b55426c5f53e5535005d4a1f7a3b702fb Added Petr Novotny, Zymurgy July/August 2017 formule to the brix_to_fg() function diff -r 65da479b5542 -r 8dae8479d5e8 www/js/global.js --- a/www/js/global.js Mon Aug 24 10:28:29 2020 +0200 +++ b/www/js/global.js Tue Aug 25 22:12:06 2020 +0200 @@ -1091,7 +1091,7 @@ var FGbh = Round(1.0031 - 0.002318474 * OBrix - 0.000007775 * (OBrix * OBrix) - 0.000000034 * Math.pow(OBrix, 3) + 0.00574 * (FBrix) + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3), 4); - // from http://seanterrill.com FGoc = old cubix, FGnc = new cubic, FGnl = new linear + // from http://seanterrill.com FGoc = old cubic, FGnc = new cubic, FGnl = new linear var OBc = OBrix / my_brix_correction; var FBc = FBrix / my_brix_correction; @@ -1107,7 +1107,10 @@ // New linear, results are pretty much too high and way off for heavy beers. var FGnl = Round(1 - 0.000856829 * OBc + 0.00349412 * FBc, 4); - console.log('brix_to_fg(' + Round(OBrix, 2) + ', ' + FBrix + ') FGbh:' + FGbh + ' FGoc:' + FGoc + ' FGnc:' + FGnc + ' FGnl:' + FGnl); + // Petr Novotny, Zymurgy July/August 2017. Used by Brewers Friend. + var FGbf = Round(1 + 0.006276 * FBc - 0.002349 * OBc, 4); + + console.log('brix_to_fg(' + Round(OBrix, 2) + ', ' + FBrix + ') FGbh:' + FGbh + ' FGoc:' + FGoc + ' FGnc:' + FGnc + ' FGnl:' + FGnl + ' FGbf:' + FGbf); return FGnc; }