280 |
280 |
281 return round(sg * 10000) / 10000; |
281 return round(sg * 10000) / 10000; |
282 } |
282 } |
283 |
283 |
284 |
284 |
285 double Utils::estimate_fg(double psugar, double pcara, double wgratio, double mashtime, double mashtemp, double svg, double og) |
285 double Utils::estimate_fg(double psugar, double pcara, double wgratio, double mashtime, double mashtemp, double svg, double og, bool sta1) |
286 { |
286 { |
287 double BD; |
287 double BD; |
288 |
288 |
289 if (psugar > 40) |
289 if (psugar > 40) |
290 psugar = 0; |
290 psugar = 0; |
308 } |
308 } |
309 if (svg < 30) |
309 if (svg < 30) |
310 svg = 77; |
310 svg = 77; |
311 |
311 |
312 /* |
312 /* |
313 * From brouwhulp: |
313 * Original from brouwhulp: |
314 * 0.00825 Attenuation factor yeast |
314 * 0.00825 Attenuation factor yeast (Real to apparant ??) |
315 * 0.00817 Attenuation factor water/grain ratio |
315 * 0.00817 Attenuation factor water/grain ratio |
316 * -0.00684 Attenuation factor mash temperature |
316 * -0.00684 Attenuation factor mash temperature |
317 * 0.00026 Attenuation factor total mash time (at some places this is 0.0026 this is wrong!) |
317 * 0.00026 Attenuation factor total mash time |
318 * -0.00356 Attenuation factor percentage crystal malt |
318 * -0.00356 Attenuation factor percentage crystal malt |
319 * 0.00553 Attenuation factor percentage simple sugars |
319 * 0.00553 Attenuation factor percentage simple sugars |
320 * 0.547 Attenuation factor constant |
320 * 0.547 Attenuation factor constant |
|
321 * 0.597 Attenuation factor constant when STA1 gen is true. |
321 */ |
322 */ |
322 double AttBeer = 0.00825 * svg + 0.00817 * BD - 0.00684 * mashtemp + 0.00026 * mashtime - 0.00356 * pcara + 0.00553 * psugar + 0.547; |
323 double AttBeer = 0.00825 * svg + 0.00817 * BD - 0.00684 * mashtemp + 0.00026 * mashtime - 0.00356 * pcara + 0.00553 * psugar; |
|
324 AttBeer += (sta1) ? 0.597:0.547; |
|
325 qDebug() << "estimate_fg(" << psugar << pcara << wgratio << mashtime << mashtemp << svg << og << sta1 << ") AttBeer:" << AttBeer; |
323 return round((1 + (1 - AttBeer) * (og -1)) * 10000) / 10000; |
326 return round((1 + (1 - AttBeer) * (og -1)) * 10000) / 10000; |
324 } |
327 } |
325 |
328 |
326 |
329 |
327 /* |
330 /* |