src/Utils.cpp

changeset 163
6cccd340ea8c
parent 135
e68b27ad8a40
child 168
4bc92122d001
equal deleted inserted replaced
162:19156b8b339f 163:6cccd340ea8c
41 * Often used formulas divide or multiply with 1.97 to convert between EBC and SRM. 41 * Often used formulas divide or multiply with 1.97 to convert between EBC and SRM.
42 * Almost all software in the world use this '1.97' formula. 42 * Almost all software in the world use this '1.97' formula.
43 * The only alternative I have seen is "srm = (ebc * 0.375 + 0.46)", and that has 43 * The only alternative I have seen is "srm = (ebc * 0.375 + 0.46)", and that has
44 * almost the same results as the formulas used in this program. 44 * almost the same results as the formulas used in this program.
45 * These formulas come from the Dutch 'brouwhulp' program written by Adrie Otten. 45 * These formulas come from the Dutch 'brouwhulp' program written by Adrie Otten.
46 *
47 * Seems that the 'brouwhulp' version use the old EBC conversion (see below) and
48 * not the new 1.97 formula. Make it selectable?
46 */ 49 */
47 double Utils::ebc_to_srm(double ebc) 50 double Utils::ebc_to_srm(double ebc)
48 { 51 {
49 double srm = -0.00000000000132303 * pow(ebc, 4) - 0.00000000291515 * pow(ebc, 3) + 0.00000818515 * pow(ebc, 2) + 0.372038 * ebc + 0.596351; 52 double srm = -0.00000000000132303 * pow(ebc, 4) - 0.00000000291515 * pow(ebc, 3) + 0.00000818515 * pow(ebc, 2) + 0.372038 * ebc + 0.596351;
50 if (ebc < 0 || srm < 0) 53 if (ebc < 0 || srm < 0)

mercurial