1082 return sg_to_plato(sg) * my_brix_correction; |
1082 return sg_to_plato(sg) * my_brix_correction; |
1083 } |
1083 } |
1084 |
1084 |
1085 |
1085 |
1086 |
1086 |
1087 function brix_to_fg(OBrix, FBrix) { |
1087 function brix_to_fg(OPt, FBrix) { |
1088 // Brouwhulp, werkt zonder brix_correctie, waarom? |
1088 // OPt = Original Plato |
1089 var FGbh = Round(1.0031 - 0.002318474 * OBrix - 0.000007775 * (OBrix * OBrix) - 0.000000034 * Math.pow(OBrix, 3) + |
1089 // FBrix = Refractometer reading. |
|
1090 // Brouwhulp |
|
1091 var FGbh = Round(1.0031 - 0.002318474 * OPt - 0.000007775 * (OPt * OPt) - 0.000000034 * Math.pow(OPt, 3) + |
1090 0.00574 * (FBrix) + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3), 4); |
1092 0.00574 * (FBrix) + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3), 4); |
1091 |
1093 |
1092 // from http://seanterrill.com FGoc = old cubic, FGnc = new cubic, FGnl = new linear |
1094 // from http://seanterrill.com FGnc = new cubic |
1093 var OBc = OBrix / my_brix_correction; |
|
1094 var FBc = FBrix / my_brix_correction; |
1095 var FBc = FBrix / my_brix_correction; |
1095 |
1096 //console.log('Correction ' + my_brix_correction + ' OPt ' + OPt + ' FBrix ' + FBrix + ' FBc ' + FBc); |
1096 // Old Cubic, almost the same a BrouwHulp, different offset and with brix_correction. |
1097 |
1097 var FGoc = Round(1.001843 - 0.002318474 * OBc - 0.000007775 * (OBc * OBc) - 0.000000034 * Math.pow(OBc, 3) + |
1098 // New cubic by Sean Terrill. |
1098 0.00574 * (FBc) + 0.00003344 * (FBc * FBc) + 0.000000086 * Math.pow(FBc, 3), 4); |
1099 var FGnc = Round(1 - 0.0044993 * (OPt) + 0.0117741 * (FBc) + |
1099 |
1100 0.000275806 * (OPt * OPt) - 0.00127169 * (FBc * FBc) - |
1100 // New cubic. This looks the best to use. |
1101 0.00000727999 * Math.pow(OPt, 3) + 0.0000632929 * Math.pow(FBc, 3), 4); |
1101 var FGnc = Round(1 - 0.0044993 * (OBc) + 0.0117741 * (FBc) + |
|
1102 0.000275806 * (OBc * OBc) - 0.00127169 * (FBc * FBc) - |
|
1103 0.00000727999 * Math.pow(OBc, 3) + 0.0000632929 * Math.pow(FBc, 3), 4); |
|
1104 |
|
1105 // New linear, results are pretty much too high and way off for heavy beers. |
|
1106 var FGnl = Round(1 - 0.000856829 * OBc + 0.00349412 * FBc, 4); |
|
1107 |
1102 |
1108 // Petr Novotny, Zymurgy July/August 2017. Used by Brewers Friend. |
1103 // Petr Novotny, Zymurgy July/August 2017. Used by Brewers Friend. |
1109 var FGbf = Round(1 + 0.006276 * FBc - 0.002349 * OBc, 4); |
1104 var FGbf = Round(1 + 0.006276 * FBc - 0.002349 * OPt, 4); |
1110 |
1105 |
1111 console.log('brix_to_fg(' + Round(OBrix, 2) + ', ' + FBrix + ') FGbh:' + FGbh + ' FGoc:' + FGoc + ' FGnc:' + FGnc + ' FGnl:' + FGnl + ' FGbf:' + FGbf); |
1106 // The real battle is now between Brouwhulp and Petr Novotny. |
1112 return FGnc; |
1107 console.log('brix_to_fg(' + Round(OPt, 2) + ', ' + FBrix + ') FGbh:' + FGbh + ' FGnc:' + FGnc + ' FGbf:' + FGbf); |
|
1108 return FGbf; |
1113 } |
1109 } |
1114 |
1110 |
1115 |
1111 |
1116 |
1112 |
1117 function estimate_sg(sugars, batch_size) { |
1113 function estimate_sg(sugars, batch_size) { |